コード例 #1
0
        public override IConnectionStringDictionary GetConnectionStringBuilder(string connectionString)
        {
            //TBD: should wrap the IConnectionStringDictionary
            IConnectionStringDictionary conectionStringBuilder = base.GetConnectionStringBuilder(connectionString);

            OleDbSqlHelper.InitConnectionStringBuilder(conectionStringBuilder);
            return(conectionStringBuilder);
        }
コード例 #2
0
        public override IConnectionStringDictionary GetConnectionStringBuilder(string connectionString)
        {
            IConnectionStringDictionary conectionStringBuilder = base.GetConnectionStringBuilder(connectionString);

            string port = (string)conectionStringBuilder [Port];

            if (port == null || port.Length == 0)
            {
                port = (string)ProviderInfo [Port];
                conectionStringBuilder.Add(Port, port);
            }

            return(conectionStringBuilder);
        }
コード例 #3
0
ファイル: GenericProvider.cs プロジェクト: pmq20/mono_forked
        public virtual java.sql.Connection GetConnection(IConnectionStringDictionary conectionStringBuilder)
        {
            string dataSourceJndi = (string)conectionStringBuilder.GetValue("jndi-datasource-name");

            if (dataSourceJndi != null && dataSourceJndi.Length > 0)
            {
                string     namingProviderUrl    = (string)conectionStringBuilder.GetValue("naming-provider-url");
                string     namingFactoryInitial = (string)conectionStringBuilder.GetValue("naming-factory-initial");
                DataSource ds = _dataSourceCache.GetDataSource(dataSourceJndi, namingProviderUrl, namingFactoryInitial);
                return(ds.getConnection());
            }

            JdbcUrlConnector connector = new JdbcUrlConnector(this, conectionStringBuilder);

            return(connector.Connection);
        }
コード例 #4
0
        public override IConnectionStringDictionary GetConnectionStringBuilder(string connectionString)
        {
            //TBD: should wrap the IConnectionStringDictionary
            IConnectionStringDictionary conectionStringBuilder = base.GetConnectionStringBuilder(connectionString);

            OleDbSqlHelper.InitConnectionStringBuilder(conectionStringBuilder);

            string port = (string)conectionStringBuilder [Port];

            if (port == null || port.Length == 0)
            {
                port = GetMSSqlPort(OleDbSqlHelper.GetInstanceName(conectionStringBuilder, DefaultInstanceName), OleDbSqlHelper.GetDataSource(conectionStringBuilder), OleDbSqlHelper.GetTimeout(conectionStringBuilder, DefaultTimeout));
                conectionStringBuilder.Add(Port, port);
            }

            return(conectionStringBuilder);
        }
コード例 #5
0
ファイル: OleDbDB2Provider.cs プロジェクト: pmq20/mono_forked
        public override IConnectionStringDictionary GetConnectionStringBuilder(string connectionString)
        {
            IConnectionStringDictionary connectionStringBuilder = base.GetConnectionStringBuilder(connectionString);

            string hostname = (string)connectionStringBuilder[Hostname];
            string port     = null;

            if (hostname == null || hostname.Length == 0)
            {
                string location = (string)connectionStringBuilder[Location];
                if (location != null)
                {
                    int semicolumnIndex = location.IndexOf(':');
                    if (semicolumnIndex != -1)
                    {
                        hostname = location.Substring(0, semicolumnIndex);
                        port     = location.Substring(semicolumnIndex + 1);
                    }
                    else
                    {
                        hostname = location;
                    }

                    if (hostname != null)
                    {
                        connectionStringBuilder.Add(Hostname, hostname);
                    }

                    if (port != null)
                    {
                        connectionStringBuilder[Port] = port;
                    }
                }
            }

            port = (string)connectionStringBuilder [Port];
            if (port == null || port.Length == 0)
            {
                port = (string)ProviderInfo [Port];
                connectionStringBuilder.Add(Port, port);
            }

            return(connectionStringBuilder);
        }
コード例 #6
0
        internal static void InitConnectionStringBuilder(IConnectionStringDictionary conectionStringBuilder)
        {
            if (!conectionStringBuilder.Contains("jndi-datasource-name"))
            {
                string database = (string)conectionStringBuilder [Database];
                if (database == null)
                {
                    conectionStringBuilder.Add(Database, String.Empty);
                }

                string dataSource   = GetDataSource(conectionStringBuilder);
                string instanceName = GetInstanceName(conectionStringBuilder, null);

                if (instanceName != null)
                {
                    conectionStringBuilder [ServerName] = dataSource + "\\" + instanceName;
                }
                else
                {
                    conectionStringBuilder [ServerName] = dataSource;
                }
            }
        }
コード例 #7
0
 public override java.sql.Connection GetConnection(IConnectionStringDictionary conectionStringBuilder)
 {
     return(new SqlServer2005Connection(base.GetConnection(conectionStringBuilder)));
 }
コード例 #8
0
ファイル: OleDbOracleProvider.cs プロジェクト: nlhepler/mono
		public override java.sql.Connection GetConnection(IConnectionStringDictionary conectionStringBuilder) {
			return new OracleConnection(base.GetConnection (conectionStringBuilder));
		}
コード例 #9
0
			internal JdbcUrlConnector (GenericProvider provider, IConnectionStringDictionary keyMapper) {
				_provider = provider;
				_keyMapper = keyMapper;
			}
コード例 #10
0
		public virtual java.sql.Connection GetConnection (IConnectionStringDictionary conectionStringBuilder)
		{
			string dataSourceJndi = (string) conectionStringBuilder.GetValue ("jndi-datasource-name");

			if (dataSourceJndi != null && dataSourceJndi.Length > 0) {

				string namingProviderUrl = (string) conectionStringBuilder.GetValue ("naming-provider-url");
				string namingFactoryInitial = (string) conectionStringBuilder.GetValue ("naming-factory-initial");
				DataSource ds = _dataSourceCache.GetDataSource(dataSourceJndi,namingProviderUrl,namingFactoryInitial);
				return ds.getConnection();
			}

			JdbcUrlConnector connector = new JdbcUrlConnector (this, conectionStringBuilder);
			return connector.Connection;
		}
コード例 #11
0
		internal static void InitConnectionStringBuilder (IConnectionStringDictionary conectionStringBuilder)
		{
			if (!conectionStringBuilder.Contains("jndi-datasource-name")) {

				string database = (string) conectionStringBuilder [Database];
				if (database == null)
					conectionStringBuilder.Add (Database, String.Empty);

				string dataSource = GetDataSource (conectionStringBuilder);
				string instanceName = GetInstanceName (conectionStringBuilder, null);

				if (instanceName != null)
					conectionStringBuilder [ServerName] = dataSource + "\\" + instanceName;
				else
					conectionStringBuilder [ServerName] = dataSource;						
			}
		}		
コード例 #12
0
		public override java.sql.Connection GetConnection(IConnectionStringDictionary conectionStringBuilder)
		{
			return new SqlServer2005Connection (base.GetConnection (conectionStringBuilder));
		}
コード例 #13
0
ファイル: GenericProvider.cs プロジェクト: pmq20/mono_forked
 internal JdbcUrlConnector(GenericProvider provider, IConnectionStringDictionary keyMapper)
 {
     _provider  = provider;
     _keyMapper = keyMapper;
 }