Oracle连接串方式
Oracle连接串方式,Oracle连接串方式如何实现?Oracle连接串方式怎样做?看看下面怎么做到的吧。
1.Connecting via TNS
"Data Source=NEWDB;User ID=SYSTEM;Password=admin";
2.Connecting Without TNSNames.ora
"Data Source = " +
"(DESCRIPTION = " +
" (ADDRESS_LIST = " +
" (ADDRESS = (PROTOCOL = TCP)" +
" (HOST = 127.0.0.1) " +
" (PORT = 1521) " +
" )" +
" )" +
" (CONNECT_DATA = " +
" (SERVICE_NAME = NEWDB)" +
" )" +
");" +
"User Id=SYSTEM;" +
"password=admin;"
3. Connecting via EZConnect
"Data Source=EDZEHOO-PC:1521/NEWDB;
User ID=SYSTEM;Password=admin";
4. Connecting with Connection Pooling Activated
OracleConnection conn = new OracleConnection();
conn.ConnectionString = "Data Source=NEWDB;
User ID=SYSTEM;
Password=admin;
Min Pool Size=10;
Max Pool Size=100;
Connection Lifetime=120;
Connection Timeout=60;
Incr Pool Size=3;
Decr Pool Size=1;"
5. Dynamically Building an ODP.NET Connection String
private string BuildConnectionString(string TNSName, string UserID, string
Password)
{
OracleConnectionStringBuilder _conn = new OracleConnectionStringBuilder();
{
_conn.DataSource = TNSName;
_conn.DecrPoolSize = 5;
_conn.IncrPoolSize = 10;
_conn.Pooling = true;
_conn.MaxPoolSize = 100;
_conn.MinPoolSize = 5;
_conn.ConnectionLifeTime = 120
_conn.ConnectionTimeout = 60
_conn.UserID = UserID;
_conn.Password = Password;
}
return _conn.ConnectionString;
}
- 默认分类(20)
- J2EE(25)
- Java(56)
- PHP(55)
- SEO(10)
- 网页设计(20)
- 网站建设(37)
- 数据库(7)
- JavaScript(17)
- JQuery(6)
- MySQL(20)
- SQL Server(6)
- Access(1)
- Oracle(6)
- office(6)
- Dreamweaver(4)
- Photoshop(12)
- Flash(9)
- Fireworks(13)
- CSS(14)
- HTML(4)
- .NET(7)
- ASP(2)
- DB2(1)
- Ajax(2)
- Linux(12)
- Struts(7)
- Hibernate(8)
- Spring(2)
- Jsp(22)
- Asp(8)
- C#(3)
- C++(1)
- 网络安全(5)
- 软件工程(7)
- XML(1)
- English(2)
- 计算机等级考试(2)
- 计算机病毒(4)
- 个人日志(76)
- 互联网(15)
- ActionScript(10)
- Android(3)
- 数据结构与算法(1)
- 游戏策略(3)
- 美文翻译(2)
- 编程开发(19)
- 计算机应用(4)
- 计算机(10)
- Unity3d(6)
- 其他(1)
- egret(1)