Other database connections

Source: Internet
Author: User
Tags connection pooling ibm db2 ibm db2 odbc driver informix interbase odbc ole oracleconnection

Mysql

    • MyODBC

MyODBC 2.50 Local Database
Driver={mysql}; Server=localhost;option=16834;database=mydatabase;

MyODBC 2.50 Remote Database
Driver={mysql}; server=myserveraddress; port=3306; option=131072; stmt=; Database=mydatabase; Uid=myusername; Pwd=mypassword;

MyODBC 3.51 Local Database
Driver={mysql ODBC 3.51 Driver}; Server=localhost;database=mydatabase; User=myusername; password=mypassword;option=3;

MyODBC 3.51 Remote Database
Driver={mysql ODBC 3.51 Driver}; server=data.domain.com; port=3306; Database=mydatabase; User=myusername; password=mypassword;option=3;

OLE DB, OleDbConnection (. NET)

Standard
Provider=mysqlprov; Data Source=mydb; User Id=myusername; Password=mypassword;

Connector/net 1.0 (. Net)
Standard
server=myserveraddress; Database=mydatabase; Uid=myusername; Pwd=mypassword;
The default port number is 3306

Specify port number
server=myserveraddress; Port=1234;database=mydatabase; Uid=myusername; Pwd=mypassword;

Named pipes
server=myserveraddress; Port=-1;database=mydatabase; Uid=myusername; Pwd=mypassword;
If the port is-1, it means to tell the driver to use the Named pipe network protocol to connect to the database.

    • Mysqlconnection (. NET)

Einfodesigns.dbprovider
Data source=myserveraddress; Database=mydatabase; User Id=myusername; Password=mypassword; Command Logging=false;

Sevenobjects mysqlclient (. NET)
Standard
host=myserveraddress; Username=myusername; Password=mypassword; Database=mydatabase;

Core Labs mysqldirect (. NET)
Standard
User Id=root; Password=mypassword; Host=localhost; Port=3306;database=mydatabase; Direct=true; PROTOCOL=TCP; Compress=false; Pooling=true; Min Pool size=0; Max Pool size=100; Connection lifetime=0;

Mysqldrivercs (. NET)
Standard
location=myserveraddress; Data source=mydatabase; Userid=myusername; Password=mypassword; port=3306; Extended properties= "" ";

Oracle

    • Odbc

New version
Driver={microsoft ODBC for Oracle}; server=myserveraddress; Uid=myusername; Pwd=mypassword;

Older versions
Driver={microsoft ODBC Driver for Oracle}; Connectstring=oracleserver.world; Uid=myusername; Pwd=mypassword;

OLE DB, OleDbConnection (. NET)

Standard connection
This connection string applies to Microsoft drivers.
Provider=msdaora;data Source=myoracledb; User Id=myusername; Password=mypassword;

Trusted connections
Provider=msdaora; Data Source=myoracledb; Persist Security Info=false; Integrated Security=yes;

Standard connection
The driver provided by Oracle.
Provider=oraoledb. Oracle;data Source=myoracledb; User Id=myusername; Password=mypassword;

Trusted connections
Provider=oraoledb.oracle;data source=myoracledb;osauthent=1;

Oracle.DataAccess.Client.OracleConnection
Standard
Data SOURCE=TORCL; User Id=myusername; Password=mypassword;

Standard secure connection
Data source=torcl;integrated Security=sspi;

Use odp.net without using Tnsnames.ora
Data source= (description= (address_list= (address= (protocol=tcp) (Host=myhost))) (Port=myport (SERVER =dedicated) (SERVICE_NAME=MYORACLESID)); User Id=myusername; Password=mypassword;

OracleConnection, Oracle Data Provider, odp.net.
System.Data.OracleClient.OracleConnection.
Standard
For 8i RC3 and later versions
Data source=myoracledb;integrated Security=yes;

Specify User name and password
For 8i RC3 and later versions
Data Source=myoracledb; User Id=myusername; Password=mypassword; Integrated Security=no;

Ignore Tnsnames.ora
Another way to connect without using DSN
Server= (description= (address= (protocol=tcp) (Host=myhost) (Port=myport)) (Connect_data= (SERVICE_NAME=MYORACLESID) )); Uid=myusername;pwd=mypassword;

Using the connection string above may cause Visual Studio to report an error.
If you see these problems in use, use the following connection.
Data source= (description= (address= (protocol=tcp) (Host=myhost) (Port=myport)) (Connect_data= (service_name= (MYORACLESID))); User Id=myusername; Password=mypassword;

Using connection pooling
If the connection pool service does not find a connection pool that already exists, it creates a new pool based on the connection string.
Otherwise, a connection that already exists in the pool is recycled.
Data Source=myoracledb; User Id=myusername; Password=mypassword; Min Pool size=10; Connection lifetime=120; Connection timeout=60;incr pool SIZE=5;DECR pool size=2;

Windows authentication
Data Source=myoracledb; User id=/;

Privileged connections
Using SYSDBA
Data Source=myoracledb; User Id=sys; Password=sys; DBA Privilege=sysdba;

Privileged connections
Using Sysoper
Data Source=myoracledb; User Id=sys; PASSWORD=SYS;DBA Privilege=sysoper;

Password expiration process
When a connection string is used to connect to the database, a "password has expired" error occurs.
Please execute the openwithnewpassword command to provide a new password.
Data Source=myoracledb; User Id=myusername; Password=mypassword; Oconn.openwithnewpassword (Sthenewpassword);

Proxy validation
Data Source=myoracledb; User Id=myusername; Password=mypassword; Proxy User Id=puserid; Proxy Password=ppassword;

Core Labs oradirect (. NET)
Standard
User Id=myusername; Password=mypassword; Host=ora; Pooling=true; Min Pool size=0; Max Pool size=100; Connection lifetime=0;

Data Shape
MS Data Shape
PROVIDER=MSDATASHAPE.1; Persist Security Info=false;data Provider=msdaora; Data Source=orac; User Id=myusername; Password=mypassword;

as/400 (iSeries)

IBM. Net Data Provider
You need to use IBM. Data.DB2.iSeries namespaces
datasource=myserveraddress; Userid=myusername; Password=mypassword;datacompression=true;

OLE DB, OleDbConnection (. NET)
IBM Client Access OLE DB Adapter
Provider=ibmda400;data Source=my_system_name; User Id=myusername; Password=mypassword;
My_system_name is the name of the system connection in Operationsnavigator.

IBM Client Access OLE DB Adapter
Provider=ibmda400;data Source=my_system_name; User Id=myusername; Password=mypassword;default collection=my_library;
My_system_name is the name of the system connection, My_library is the name of the library in iseries Navigator.

Odbc
IBM Client Access ODBC Driver
Driver={client Access ODBC Driver (32-bit)}; System=my_system_name; Uid=myusername; Pwd=mypassword;

IBM iSeries Access ODBC Driver
This driver requires newer drivers than IBM Client Access ODBC.
Driver={iseries Access ODBC Driver}; System=my_system_name; Uid=myusername; Pwd=mypassword;

Caché

Odbc
Standard
Driver={intersystems ODBC}; server=myserveraddress; Database=mydatabase; Uid=myusername; Pwd=mypassword;

Specific ports
Driver={intersystems ODBC}; server=myserveraddress; port=12345; Database=mydatabase; Uid=myusername; Pwd=mypassword;

Specific protocols
Driver={intersystems ODBC}; server=myserveraddress; port=12345; Database=mydatabase; PROTOCOL=TCP; STATIC Cursors=1; Uid=myusername; Pwd=mypassword;

IBM DB2

OLE DB, OleDbConnection (. NET)
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-provided OLE DB adapters
Tcp / ip
Provider=ibmdadb2;database=mydatabase; hostname=myserveraddress; Protocol=tcpip; port=50000; Uid=myusername; Pwd=mypassword;

Odbc
Standard
DRIVER={IBM DB2 ODBC Driver}; Database=mydatabase; hostname=myserveraddress; port=1234; Protocol=tcpip; Uid=myusername; Pwd=mypassword;

Firebird

Odbc-ibphoenix Open Source
Standard
Driver=firebird/interbase (R) Driver; UID=SYSDBA; Pwd=masterkey; Dbname=d:/firebird/examples/test. FDB;

. Net-firebird. NET Data Provider
Standard
USER=SYSDBA; Password=masterkey;database=sampledatabase.fdb; Datasource=localhost; port=3050;dialect=3; Charset=none; role=; Connection lifetime=15; Pooling=true; minpoolsize=0; maxpoolsize=50; Packet size=8192; servertype=0;

Informix

Odbc
Informix 3.30
dsn=;D river={informix 3.30-BIT}; Host=hostname; server=myserveraddress; Service=service-name; PROTOCOL=OLSOCTCP; Database=mydatabase; Uid=myusername; Pwd=mypassword;

INFORMIX-CLI 2.5:
DRIVER={INFORMIX-CLI 2.5 (+ Bit)}; server=myserveraddress; Database=mydatabase; Uid=myusername; Pwd=mypassword;

OLE DB
IBM Informix OLE DB Provider
PROVIDER=IFXOLEDBC.2; Password=mypassword; User Id=myusername; Data [email protected]; Persist Security info=true;

IBM Informix. NET Provider
IBM.Data.Informix.IfxConnection (namespace)
Database=mydatabase; host=192.168.10.10; SERVER=DB_ENGINE_TCP; service=1492; PROTOCOL=ONSOCTCP; Uid=myusername; Password=mypassword;

# #Ingres

Odbc
Dsn-less
Provider=msdasql.1;driver=ingres; srvr=xxxxx;db=xxxxx; Persist Securityinfo=false; Uid=myusername; Pwd=mypassword; Selectloops=n; Extendedproperties= "SERVER=XXXXX;DATABASE=XXXXX; Servertype=ingres ";

Interbase

ODBC, Easysoft
Local computer
Driver={easysoft IB6 ODBC}; Server=localhost;D atabase=localhost:c:/mydatabase.gdb; Uid=myusername; Pwd=mypassword;

remote computer
Driver={easysoft IB6 ODBC}; server=myserveraddress; Database=computername:c:/mydatabase.gdb; Uid=myusername; Pwd=mypassword;

ODBC, Intersolv
Local computer
Driver={intersolv InterBase ODBC Driver (*.GDB)}; Server=localhost; Database=localhost:c:/mydatabase.gdb; Uid=myusername; Pwd=mypassword;

remote computer
Driver={intersolv InterBase ODBC Driver (*.GDB)}; server=myserveraddress; Database=computername:c:/mydatabase.gdb; Uid=myusername; Pwd=mypassword;

OLE DB, Sibprovider
Standard
Provider=sibprovider;location=localhost:;d ata source=c:/databases/gdbs/mygdb.gdb; User id=sysdba; Password=masterkey;

Version 2.x
Provider=sibprovider.2; Data source=localhost:c:/databases/gdbs/mygdb.gdb; Persist Security Info=false;

Specifying a character Set
Provider=sibprovider;location=localhost:;d ata source=c:/databases/gdbs/mygdb.gdb; User id=sysdba; Password=masterkey; Character Set=iso8859_1;

Specify roles
Provider=sibprovider;location=localhost:; Data Source=c:/databases/gdbs/mygdb.gdb;user id=sysdba; Password=masterkey; Role=digitadores;

Lightbase

Standard connection
Standard
User=myusername; Password=mypassword; Udb=userbase; server=myserveraddress;

Paradox

Odbc
4.9
Driver={microsoft Paradox Driver (*.db)}; driverid=538; Fil=paradox 5.X; defaultdir=c:/pathtodb/;D bq=c:/pathtodb/; Collatingsequence=ascii;

7.X
PROVIDER=MSDASQL.1; Persist Security Info=false; Mode=read; Extended Properties=dsn=paradox; dbq=c:/mydb;defaultdir=c:/mydb;driverid=538; Fil=paradox 7.X; maxbuffersize=2048; Pagetimeout=600;;i Nitial Catalog=c:/mydb;
Please note: The above method can only fetch data from the database.

Intersolv 3.11 ODBC Driver
7.X
DSN=MYDSN; Aut=1; ct=7;dq=0; Foc=0;is=1; Pw=mypassword; usf=1; Ulq=1;

Not all parameters are required. Most of the parameters can be set in the DSN.
Parameters definition
Aut-applicationusingthreads
Ct-createtype
Db-database
Dsn-datasourcename
Dq-deferqueryevaluation
Foc-fileopencache
Is-intlsort
Nd-netdir
Pw-passwords
Usf-ultrasafecommit
Ulq-uselongqualifiers

OleDbConnection (. NET)
Standard
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:/mydb; Extended Properties=paradox 5.x;
Note: You only need to specify the address where the database resides without specifying the name of the database.

SQLBase

OLE DB
Standard
Provider=sqlbaseoledb;data source=myserveraddress; Location=mydatabase; User Id=myusername; Password=mypassword;

SQLBase. NET Data Provider
Standard SQLBase Connection
datasource=myserveraddress; Userid=myusername; Password=mypassword; poolsize=5; Connection lifetime=60;
"Poolsize" indicates how many sqlbase connections are open, whether or not they are used immediately. The default value is 5.
"Connection Lifetime" indicates how long the connection exists (in seconds). The default is 60 seconds.

SQL Server

Odbc
Standard connection
Driver={sql Server}; server=myserveraddress; Database=mydatabase; Uid=myusername; Pwd=mypassword;

Connected by a letter
Driver={sql Server}; server=myserveraddress; Database=mydatabase; Trusted_connection=yes;

Specify account number and password
Oconn.properties ("Prompt") = adPromptAlways driver={sql Server}; Server=myserveraddress;database=mydatabase;

OLE DB, OleDbConnection (. NET)
Standard connection
Provider=sqloledb;data source=myserveraddress;initial catalog=mydatabase; User Id=myusername; Password=mypassword;

Connected by a letter
Provider=sqloledb;data source=myserveraddress;initial catalog=mydatabase;integrated Security=SSPI;
You can specify an instance of SQL Server using Servername/instancename as the data source.

Connect to an instance of SQL Server
The expression for the specified server instance is the same as other SQL Server connection strings.
Provider=sqloledb; Data Source=myservername/theinstancename; Initial catalog=mydatabase;integrated Security=sspi;

Specify account and password
Oconn.provider = "SQLOLEDB" Oconn.properties ("Prompt") = adPromptAlways Data source=myserveraddress;initial catalog= MyDataBase;

Connect using an IP address
Provider=sqloledb;data source=190.190.200.100,1433; Network library=dbmssocn;initial catalog=mydatabase; User Id=myusername; Password=mypassword;

SqlConnection (. NET)
Standard connection
Data source=myserveraddress;initial catalog=mydatabase; User Id=myusername; Password=mypassword;

Standard Security Alternative syntax
Server=myserveraddress;database=mydatabase; User Id=myusername; Password=mypassword; Trusted_connection=false;

Trusted connections
Data source=myserveraddress;initial catalog=mydatabase;integrated Security=sspi;

Trusted Connection Alternative syntax
Server=myserveraddress;database=mydatabase; Trusted_connection=true;

Connecting to an instance of SQL Server
The expression for the specified server instance is the same as other SQL Server connection strings.
Server=myservername/theinstancename;database=mydatabase; Trusted_connection=true;

Can only be used for CE equipment.
Data source=myserveraddress;initial catalog=mydatabase;integrated Security=sspi; User Id=mydomain/myusername; Password=mypassword;

connection with an IP address
Data source=190.190.200.100,1433; Network library=dbmssocn;initial catalog=mydatabase; User Id=myusername; Password=mypassword;

Specify the size of the package
Server=myserveraddress;database=mydatabase; User Id=myusername; Password=mypassword; Trusted_connection=false; Packet size=4096;
The default package size is 8192 bytes.

Data Shape
MS Data Shape
Provider=msdatashape;data Provider=sqloledb;data source=myserveraddress; Initial catalog=mydatabase; User Id=myusername; Password=mypassword;

Other database connections

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.