Connection String Attribute |
默认值 |
描述 |
Connection Lifetime |
0 |
Maximum life time (in seconds) of the connection 当数据库连接被返回到连接池中时,它的创建时间将与当前时间比较,如果超过了 Connection Lifetime 规定的时间,它将被释放掉。 为 0 时将被视为最大连接时间。 |
Connection Timeout |
15 |
Maximum time (in seconds) to wait for a free connection from the pool |
Data Source |
empty string |
Oracle Net Service Name that identifies the database to connect to |
DBA Privilege |
empty string |
Administrative privileges: SYSDBA or SYSOPER |
Decr Pool Size |
1 |
Controls the number of connections that are closed when an excessive amount of established connections are unused |
Enlist |
true |
Enables or disables serviced components to automatically enlist in distributed transactions 当此值为 true 时,池中现存的所有数据库连接将被加入到它的创建线程的 Transaction Context 中。如果不存在这个 Transaction Context 则无任何变化。 |
Incr Pool Size |
5 |
Controls the number of connections that are established when all the connections in the pool are used |
Max Pool Size |
100 |
Maximum number of connections in a pool |
Min Pool Size |
1 |
Minimum number of connections in a pool |
Password |
empty string |
Password for the user specified by User Id |
Persist Security Info |
false |
Enables or disables the retrieval of password in the connection string |
Pooling |
true |
Enables or disables connection pooling |
Proxy User Id |
empty string |
User name of the proxy user |
Proxy Password |
empty string |
Password of the proxy user |
User Id |
empty string |
Oracle user name |
// C#
...
OracleConnection con = new OracleConnection();
con.ConnectionString = "User Id=scott;Password=tiger;Data Source=oracle;Pooling=true;Enlist=true;Min Pool Size=10;Connection Lifetime=120;Connection Timeout=60;Incr Pool Size=5; Decr Pool Size=2";
con.Open();
...
以下网站提供连接字符串大全:
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
· 如何调用 DeepSeek 的自然语言处理 API 接口并集成到在线客服系统