Database Connection Strings

This topic provides information on database connection strings for various server types: MS SQL Server, mySQL, Oracle, and IBM DB2.

MS SQL Server 2008

JDBC SQL Server 2008 Runtime Connection

jdbc:sqlserver://hostname:port;user=username;password=password;DatabaseName=database

hostname = Computer name where MS SQLServer is running

port = MS SQLServer Listener Port number (DEFAULT=1433)

database = MS SQLServer database name

username = MS SQLServer user name

password = MS SQLServer password

JDBC SQLServer 2008 Provider

MSSQL2005.jdbc.SQLServerDriver

To use the MSSQL2005.jdbc.SQLServerDriver, you must have the sqljdbc4.jar file in the server’s CLASSPATH. One such spot is in the TOMCAT_HOME/common/lib directory (for Tomcat), or any location that will be accessible to the Java Web Server running the generated Agent Scripting Web application.

MS SQLServer

Development Connection (ODBC)

data source=hostname;Database=dbname;UID=username;Password=password

hostname = Computer name where MS SQLServer is running

dbname = MS SQLServer database name

username = MS SQL server user name

password = MS SQL server password

IIS Provider

SQLOLEDB

System.Data.SqlClient

IIS Runtime Connection

Database=database;UID=username;Password=password
Note:
When SQL Server is located on a remote host, use:
S
erver=server_name;Database=database;UID=username;Password=password;)

database = MS SQLServer database name

username = MS SQLServer user name

password = MS SQLServer password

JDBC SQLServer 2005 Provider

MSSQL2005.jdbc.SQLServerDriver

To use the MSSQL2005.jdbc.SQLServerDriver, you must have the sqljdbc.jar file in the server’s CLASSPATH. One such spot is in the TOMCAT_HOME/common/lib directory (for Tomcat), or any location that will be accessible to the Java Web Server running the generated Agent Scripting Web application.

JDBC SQLServer 2000 Provider

com.microsoft.jdbc.sqlserver.SQLServerDriver

To use the JDBC driver com.microsoft.jdbc.sqlserver.SQLServerDriver, you must have the files mssqlserver.jar, msbase.jar, and msutil.jar in the server’s CLASSPATH. One such spot is in the TOMCAT_HOME/common/lib directory (for Tomcat), or any location that will be accessible to the Java Web Server running the generated Agent Scripting Web application.

JDBC SQLServer 2005 Runtime Connection

jdbc:sqlserver://hostname:port;user=username;password=password;DatabaseName=database

hostname = Computer name where MS SQLServer is running

port = MS SQLServer Listener Port number (DEFAULT=1433)

database = MS SQLServer database name

username = MS SQLServer user name

password = MS SQLServer password

JDBC SQLServer 2000 Runtime Connection

jdbc:microsoft:sqlserver://hostname:port;user=username;password=password;DatabaseName=database

hostname = Computer name where MS SQLServer is running

port = MS SQLServer Listener Port number (DEFAULT=1433)

database = MS SQLServer database name

username = MS SQLServer user name

password = MS SQLServer password

Other Information

Make sure the services are started after installation.

mySQL

Development Connection (ODBC)

DSN=dsn;UID=username;Password=password

dsn = Data source name from ODBC Control panel

username = mySQL server user name

password = mySQL server password

JDBC Provider

com.mysql.jdbc.Driver

JDBC Runtime Connection

jdbc:mysql://hosturl:port/database?user=username&password=password

hosturl = URL of sight where mySQL database is running

port = mySQL Listener Port number (DEFAULT=3306)

database = mySQL database name

username = mySQL user name

password = mySQL password

Oracle

Development Connection (ODBC)

DSN=dsn;UID=username;Password=password

dsn = Data source name from ODBC Control panel

username = Oracle user name

password = Oracle password

IIS Provider

OraOLEDB.Oracle

System.Data.OracleClient

IIS Runtime Connection

Data Source=TNSName;User ID=username;Password=password

TNSName = Oracle database local Service Name as defined in tnsnames.ora configuration file.

username = Oracle user name

password = Oracle password

JDBC Provider

oracle.jdbc.OracleDriver

oracle.jdbc.pool.OracleConnectionCacheImpl for a pooled cached connection

JDBC Runtime Connection

Two possible connection strings:

jdbc:oracle:thin:username/password@hostname:port:sid

username = Oracle user name

password = Oracle password

hostname = Computer name where Oracle is running

port = Oracle Listener Port number (DEFAULT=1521)

sid = Oracle database SID as defined in tnsnames.ora

jdbc:oracle:oci:username/password@TNSName

username = Oracle user name

password = Oracle password

TNSName = Oracle database local Service Name as defined in tnsnames.ora  configuration file.

Other Information

For IIS you must grant read/execute permission on the Oracle home directory to IUSR_xxx where xxx is the machine name.

For JDBC make sure that the classes12.jar file is in the common/lib folder (for Tomcat), or any location that will be accessible to the Java Web Server running the generated Agent Scripting Web application.

IBM DB2

Development Connection (ODBC)

DSN=dsn;UID=username;PWD=password

dsn = Data source name from ODBC Control panel

username = IBM DB2 server user name

password = IBM DB2 server password

IIS Provider

IBMDADB2

IBM.Data.DB2

IIS Runtime Connection for provider IBMDADB2

DSN=database;UID=username;PWD=password

database  =   IBM DB2 database (alias) name

username = IBM DB2Server user name

password = IBM DB2Server user password

IIS Runtime Connection for provider IBM.Data.DB2

Server=server:port;Database=database;UID=username;PWD=password

Server:port = Name of computer running IBM DB2Server:port number (Default port number is 50000)

database = IBM DB2Server database name

username = IBM DB2Server user name

password = IBM DB2Server user password

JDBC Provider

com.ibm.db2.jcc.DB2Driver

JDBC Runtime Connection

jdbc:db2://Server:port/Database:user=User_ID;

password=password;

Server = Computer name where IBM DB2 server is running.

port = IBM DB2 server listener port number (DEFAULT=50000)

database = IBM DB2Server database name

User_ID = IBM DB2Server user name

password = IBM DB2Server password

Other Information

  1. IBM DB2 client is at version 8.1.7 or higher for provider = IBM.Data.DB2.

  2. For JDBC, make sure that the file db2jcc.jar file is in the common/lib folder (for Tomcat), or any location that will be accessible to the Java Web Server running the generated Agent Scripting Web application.