ODBC |
Driver={Microsoft ODBC for Oracle};Server=myServerAddress;Uid=myUsername;Pwd=myPassword; | |
|
|
Driver={Microsoft ODBC Driver for Oracle};ConnectString=OracleServer.world;Uid=myUsername;Pwd=myPassword; | |
|
|
OLE DB, OleDbConnection (.NET) |
此连接字符串适用了微软的驱动。 |
|
Provider=msdaora;Data Source=MyOracleDB;User Id=myUsername;Password=myPassword; | |
|
|
Provider=msdaora;Data Source=MyOracleDB;Persist Security Info=False;Integrated Security=Yes; | |
|
|
由Oracle提供的驱动。 |
|
Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;User Id=myUsername;Password=myPassword; | |
|
|
Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;OSAuthent=1; | |
|
|
Data Source=TORCL;User Id=myUsername;Password=myPassword; | |
|
|
Data Source=TORCL;Integrated Security=SSPI; | |
|
|
Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=MyOracleSID)));User Id=myUsername;Password=myPassword; | |
|
|
OracleConnection, Oracle Data Provider, ODP.NET, System.Data.OracleClient.OracleConnection |
Data Source=MyOracleDB;Integrated Security=yes; | |
|
|
Data Source=MyOracleDB;User Id=myUsername;Password=myPassword;Integrated Security=no; | |
|
|
另一种不需要使用DSN的连接方式。 |
|
SERVER=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort))(CONNECT_DATA=(SERVICE_NAME=MyOracleSID)));uid=myUsername;pwd=myPassword; | |
|
|
使用上面的连接字符串可能会导致Visual Studio报告错误,如果您在使用中出现了这些问题,请使用下面的这种连接方式。 |
|
Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort))(CONNECT_DATA=(SERVICE_NAME=MyOracleSID)));User Id=myUsername;Password=myPassword; | |
|
|
如果连接池服务程序找不到已经存在的连接池,它将根据连接字符串创建一个新的池,否则将循环使用池中已存在的连接。 |
|
Data Source=myOracleDB;User Id=myUsername;Password=myPassword;Min Pool Size=10;Connection Lifetime=120;Connection Timeout=60;Incr Pool Size=5;Decr Pool Size=2; | |
|
|
Data Source=myOracleDB;User Id=/; | |
|
|
使用SYSDBA |
|
Data Source=myOracleDB;User Id=SYS;Password=SYS;DBA Privilege=SYSDBA; | |
|
|
使用SYSOPER |
|
Data Source=myOracleDB;User Id=SYS;Password=SYS;DBA Privilege=SYSOPER; | |
|
|
当使用一个连接字符串连接数据库后,出现“密码已过期”的错误时,请执行OpenWithNewPassword命令来提供新密码。 |
|
Data Source=myOracleDB;User Id=myUsername;Password=myPassword;
oConn.OpenWithNewPassword(sTheNewPassword); | |
|
|
Data Source=myOracleDB;User Id=myUsername;Password=myPassword;Proxy User Id=pUserId;Proxy Password=pPassword; | |
|
|
Core Labs OraDirect (.NET) |
User ID=myUsername;Password=myPassword;Host=ora;Pooling=true;Min Pool Size=0;Max Pool Size=100;Connection Lifetime=0; | |
|
|
Data Shape |
Provider=MSDataShape.1;Persist Security Info=False;Data Provider=MSDAORA;Data Source=orac;User Id=myUsername;Password=myPassword; | |
|