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
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.
InterBase(暂无)
优质内容筛选与推荐>>
1、[大牛翻译系列]Hadoop 翻译文章索引
2、思考
3、私有程序集与共享程序集
4、经常下载的朋友注意了,教你怎样硬盘零伤害(从论坛上拷下来收藏的)
5、JavaScript 获取数组中最大值、最小值


长按二维码向我转账

受苹果公司新规定影响,微信 iOS 版的赞赏功能被关闭,可通过二维码转账支持公众号。

    阅读
    好看
    已推荐到看一看
    你的朋友可以在“发现”-“看一看”看到你认为好看的文章。
    已取消,“好看”想法已同步删除
    已推荐到看一看 和朋友分享想法
    最多200字,当前共 发送

    已发送

    朋友将在看一看看到

    确定
    分享你的想法...
    取消

    分享想法到看一看

    确定
    最多200字,当前共

    发送中

    网络异常,请稍后重试

    微信扫一扫
    关注该公众号