Informax.SqlCenter跨数据库平台(三)——连接字符串
在我们配置数据库连接字符串的时候,经常会因为参数的名称和可选项的使用而感到迷惑。为了解决这个问题Informax.SqlCenter为各种数据库的连接字符串提供了数据实体类,通过这些实体类对属性进行赋值使用ToString()方法得到正确配置的连接字符串,或者使用已经配置好的连接字符串使用Parse方法可以将连接字符串解析成数据实体。以下是内置的五种数据库连接字符串的参考文档:
SqlServer
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatasqlclientsqlconnectionclassconnectionstringtopic.asp
Oracle
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDataOracleClientOracleConnectionClassConnectionStringTopic.asp
DB2
http://publib.boulder.ibm.com/infocenter/db2help/index.jsp?topic=/com.ibm.db2.udb.dndp.doc/htm/frlrfIBMDataDB2DB2ConnectionClassConnectionStringTopic.htm
MySql
NameDescription
InterBase(暂无)
SqlServer
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatasqlclientsqlconnectionclassconnectionstringtopic.asp
Oracle
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDataOracleClientOracleConnectionClassConnectionStringTopic.asp
DB2
http://publib.boulder.ibm.com/infocenter/db2help/index.jsp?topic=/com.ibm.db2.udb.dndp.doc/htm/frlrfIBMDataDB2DB2ConnectionClassConnectionStringTopic.htm
MySql
NameDescription
Compress | If true, enables transferred data compression. The default value is false. |
Connection Lifetime | When a connection is returned to the pool, its creation time is compared with the current time, and the connection is destroyed if that time span (in seconds) exceeds the value specified by Connection Lifetime. The default value is 0 (connection always returns to pool). |
Connect Timeout -or- Connection Timeout | The length of time (in seconds) to wait for a connection to the server before terminating the attempt and generating an error. The default value is 15. |
Data Source -or- Host -or- Server | The name or IP address of host of MySQL database to which to connect. |
Database | The name of the database. |
Direct | If true, by default, allows not to use MySQL client library (libmysql.dll) to access MySQL server. |
Embedded | If true, allows to use Embedded MySQL server. The default value is false |
Max Pool Size | The maximum number of connections allowed in the pool. Setting the Max Pool Size value of the ConnectionString can affect performance. The default value is 100. |
Min Pool Size | The minimum number of connections allowed in the pool. The default value is 0. |
Password | The password for the account. |
Pooling | If true, by default, the MySqlConnection object is drawn from the appropriate pool or is created and added to the appropriate pool. |
Port | The port of MySQL database to which to connect. The default value is 3306. |
Protocol | The type of the network protocol which will be used to access to MySQL server. The default value is Tcp. |
Unicode | If true, sets client charset to UTF8 and converts client data according to this charset. The default value is false. |
User ID -or- User | The MySQL login account. |
posted on 2005-06-13 22:13 Edward.Net 阅读(435) 评论(0) 收藏 举报