关于数据库连接字符串问题(第四部分连接 IBM DB2)
2011-06-19 10:33
633 查看
IBM 的DB2数据库应用的还比较广泛,不过关于连接这一块的文章还是比较少的,所以本人就在这贴出关于DB2的数据库,连接方式,共大家学习。
Providers for IBM DB2
DB2 .NET Data Provider
Type: .NET Framework Class Library
Usage: IBM.Data.DB2.DB2Connection
Manufacturer: IBM
More info about this class library »
Customize string
example values »
Standard
Server=myAddress:myPortNumber;Database=myDataBase;UID=myUsername;PWD=myPassword;
The Server key value syntax is a server name / ip address and an optional port number (note the : in between).
Defining the connection pooling pool size
Server=myAddress:myPortNumber;Database=myDataBase;UID=myUsername;PWD=myPassword;Max Pool Size=100;Min Pool Size=10;
Disable connection pooling
Server=myAddress:myPortNumber;Database=myDataBase;UID=myUsername;PWD=myPassword; Pooling=false;
Connection pooling, time in pool
Server=myAddress:myPortNumber;Database=myDataBase;UID=myUsername;PWD=myPassword; Connection Lifetime=60;
Defines how many seconds the connection can remain idle in the pool before its removed from the pool.
Connection pooling, do not pool
Server=myAddress:myPortNumber;Database=myDataBase;UID=myUsername;PWD=myPassword; Connection Reset=false;
Specifying schema
Server=myAddress:myPortNumber;Database=myDataBase;UID=myUsername;PWD=myPassword; CurrentSchema=mySchema;
All unqualified SQL objects used with the current connection will be qualified with the provide schema name
Microsoft OLEDB provider for DB2
Type: OLE DB Provider
Usage: Provider=DB2OLEDB
Manufacturer: Microsoft
More info about this provider »
Customize string
example values »
TCP/IP
Provider=DB2OLEDB;Network Transport Library=TCPIP;Network Address=xxx.xxx.xxx.xxx;Initial Catalog=MyCtlg;Package Collection=MyPkgCol;Default Schema=Schema;User ID=myUsername;Password=myPassword;
APPC
Provider=DB2OLEDB;APPC Local LU Alias=MyAlias;APPC Remote LU Alias=MyRemote;Initial Catalog=MyCtlg;Package Collection=MyPkgCol;Default Schema=Schema;User ID=myUsername;Password=myPassword;
IBM OLE DB Provider for DB2
Type: OLE DB Provider
Usage: Provider=IBMDADB2
Manufacturer: IBM
More info about this provider »
Customize string
example values »
TCP/IP
Provider=IBMDADB2;Database=myDataBase;Hostname=myServerAddress;Protocol=TCPIP; Port=50000;Uid=myUsername;Pwd=myPassword;
.NET Framework Data Provider for OLE DB
Type: .NET Framework Wrapper Class Library
Usage: System.Data.OleDb.OleDbConnection
Manufacturer: Microsoft
More info about this wrapper class library »
Customize string
example values »
Bridging to IBM OLE DB Provider for DB2
This is just one connection string sample for the wrapping OleDbConnection class that calls the underlying OLEDB provider. See respective OLE DB provider for more connection strings to use with this class.
Provider=IBMDADB2;Database=myDataBase;Hostname=myServerAddress;Protocol=TCPIP; Port=50000;Uid=myUsername;Pwd=myPassword;
IBM DB2 Driver for ODBC and CLI
Type: ODBC Driver
Usage: Driver={IBM DB2 ODBC DRIVER}
Manufacturer: IBM
More info about this driver »
Customize string
example values »
Standard
Driver={IBM DB2 ODBC DRIVER};Database=myDataBase;Hostname=myServerAddress;Port=1234; Protocol=TCPIP;Uid=myUsername;Pwd=myPassword;
.NET Framework Data Provider for ODBC
Type: .NET Framework Wrapper Class Library
Usage: System.Data.Odbc.OdbcConnection
Manufacturer: Microsoft
More info about this wrapper class library »
Customize string
example values »
Bridging to IBM DB2 Driver for ODBC and CLI
This is just one connection string sample for the wrapping OdbcConnection class that calls the underlying ODBC Driver. See respective ODBC driver for more connection strings to use with this class.
Driver={IBM DB2 ODBC DRIVER};Database=myDataBase;Hostname=myServerAddress;Port=1234; Protocol=TCPIP;Uid=myUsername;Pwd=myPassword;
Providers for IBM DB2
DB2 .NET Data Provider
Type: .NET Framework Class Library
Usage: IBM.Data.DB2.DB2Connection
Manufacturer: IBM
More info about this class library »
Customize string
example values »
Standard
Server=myAddress:myPortNumber;Database=myDataBase;UID=myUsername;PWD=myPassword;
The Server key value syntax is a server name / ip address and an optional port number (note the : in between).
Defining the connection pooling pool size
Server=myAddress:myPortNumber;Database=myDataBase;UID=myUsername;PWD=myPassword;Max Pool Size=100;Min Pool Size=10;
Disable connection pooling
Server=myAddress:myPortNumber;Database=myDataBase;UID=myUsername;PWD=myPassword; Pooling=false;
Connection pooling, time in pool
Server=myAddress:myPortNumber;Database=myDataBase;UID=myUsername;PWD=myPassword; Connection Lifetime=60;
Defines how many seconds the connection can remain idle in the pool before its removed from the pool.
Connection pooling, do not pool
Server=myAddress:myPortNumber;Database=myDataBase;UID=myUsername;PWD=myPassword; Connection Reset=false;
Specifying schema
Server=myAddress:myPortNumber;Database=myDataBase;UID=myUsername;PWD=myPassword; CurrentSchema=mySchema;
All unqualified SQL objects used with the current connection will be qualified with the provide schema name
Microsoft OLEDB provider for DB2
Type: OLE DB Provider
Usage: Provider=DB2OLEDB
Manufacturer: Microsoft
More info about this provider »
Customize string
example values »
TCP/IP
Provider=DB2OLEDB;Network Transport Library=TCPIP;Network Address=xxx.xxx.xxx.xxx;Initial Catalog=MyCtlg;Package Collection=MyPkgCol;Default Schema=Schema;User ID=myUsername;Password=myPassword;
APPC
Provider=DB2OLEDB;APPC Local LU Alias=MyAlias;APPC Remote LU Alias=MyRemote;Initial Catalog=MyCtlg;Package Collection=MyPkgCol;Default Schema=Schema;User ID=myUsername;Password=myPassword;
IBM OLE DB Provider for DB2
Type: OLE DB Provider
Usage: Provider=IBMDADB2
Manufacturer: IBM
More info about this provider »
Customize string
example values »
TCP/IP
Provider=IBMDADB2;Database=myDataBase;Hostname=myServerAddress;Protocol=TCPIP; Port=50000;Uid=myUsername;Pwd=myPassword;
.NET Framework Data Provider for OLE DB
Type: .NET Framework Wrapper Class Library
Usage: System.Data.OleDb.OleDbConnection
Manufacturer: Microsoft
More info about this wrapper class library »
Customize string
example values »
Bridging to IBM OLE DB Provider for DB2
This is just one connection string sample for the wrapping OleDbConnection class that calls the underlying OLEDB provider. See respective OLE DB provider for more connection strings to use with this class.
Provider=IBMDADB2;Database=myDataBase;Hostname=myServerAddress;Protocol=TCPIP; Port=50000;Uid=myUsername;Pwd=myPassword;
IBM DB2 Driver for ODBC and CLI
Type: ODBC Driver
Usage: Driver={IBM DB2 ODBC DRIVER}
Manufacturer: IBM
More info about this driver »
Customize string
example values »
Standard
Driver={IBM DB2 ODBC DRIVER};Database=myDataBase;Hostname=myServerAddress;Port=1234; Protocol=TCPIP;Uid=myUsername;Pwd=myPassword;
.NET Framework Data Provider for ODBC
Type: .NET Framework Wrapper Class Library
Usage: System.Data.Odbc.OdbcConnection
Manufacturer: Microsoft
More info about this wrapper class library »
Customize string
example values »
Bridging to IBM DB2 Driver for ODBC and CLI
This is just one connection string sample for the wrapping OdbcConnection class that calls the underlying ODBC Driver. See respective ODBC driver for more connection strings to use with this class.
Driver={IBM DB2 ODBC DRIVER};Database=myDataBase;Hostname=myServerAddress;Port=1234; Protocol=TCPIP;Uid=myUsername;Pwd=myPassword;
相关文章推荐
- 关于数据库连接字符串问题(第二部分连接MySQL)
- 关于数据库连接字符串问题(第五部分连接access-2007)
- 关于数据库连接字符串问题(第三部分连接Oracle)
- 关于LINQ中数据库连接字符串的问题
- 关于数据库连接字符串问题(第一部分连接SQL Server 2008)
- Web.config中关于数据库连接字符串配置问题
- 关于c#在控制台应用程序中连接数据库字符串的问题
- 数据库连接字符串 - IBM DB2
- 关于打开现有项目时数据库连接配置遇到的问题 连接字符串中的数据源值指定未安装的SQL Server的实例。要解决此问题,可选择安装匹配的SQL Server实例或修改连接字符串中的数据源值
- (转)关于c#在控制台应用程序中连接数据库字符串的问题
- [数据库连接字符串] IBM DB2 连接字符串
- 关于Hibernate3,mysql5 数据库连接超过8小时 连接超时的问题及解决方案(部分摘自网络)
- 关于VS 使用 OCCI 连接Oracle 数据库的问题记录
- 关于metasploit下连接postgresql数据库问题
- 关于数据库连接的小问题
- 关于数据库优化2——关于表的连接顺序,和where子句的前后顺序,是否会影响到sql的执行效率问题
- 关于利用JDBC连接sqlserver中数据库的问题
- 关于IBM数据库DB2 9的九大特性简介(1)
- 我用的是stringgrid连接数据库!关于提高性能的问题
- 关于JSP连接SQL Server 2000数据库的问题