JDBC Drivers and Connection Strings
JDBC Drivers and Connection Strings
MySQL:
Oracle:
Driver : "oracle.jdbc.driver.OracleDriver"
Connection String : "jdbc:oracle:thin@Server_name:Port_number/Database_name"
Server_name :
Default : localhost,
Other ex: www.yourDomain.com, www.abc.com
Port_number :
default : 1521
Database_name :
Name of the database to which you want to connect
IBM's DB2:
MicroSoft's SQLServer:
Driver : "com.jnetdirect.jsql.JSQLDriver"
Connection String : "jdbc:JSQLConnect://Server_name:Port_number/Database_name"
Server_name :
Default: localhost
Other ex: www.yourDomain.com, www.abc.com
Port_number :
default : 1433
Database_name :
Name of the database to which you want to connect
IBM DB2
jdbc:db2://<HOST>:<PORT>/<DB>
COM.ibm.db2.jdbc.app.DB2Driver <-- Type 2
com.ibm.db2.jcc.DB2Driver <-- Type 4
JDBC-ODBC Bridge
jdbc:odbc:<DB>
sun.jdbc.odbc.JdbcOdbcDriver
Oracle Thin
jdbc:oracle:thin:@<HOST>:<PORT>:<SID>
oracle.jdbc.driver.OracleDriver
Cloudscape
jdbc:cloudscape:<DB>
COM.cloudscape.core.JDBCDriver
Cloudscape RMI
jdbc:rmi://<HOST>:<PORT>/jdbc:cloudscape:<DB>
RmiJdbc.RJDriver
IDS Server
jdbc:ids://<HOST>:<PORT>/conn?dsn='<ODBC_DSN_NAME>'
ids.sql.IDSDriver
Informix Dynamic Server
jdbc:informix-sqli://<HOST>:<PORT>/<DB>:INFORMIXSERVER=<SERVER_NAME>
com.informix.jdbc.IfxDriver
Oracle OCI 8i
jdbc:oracle:oci8:@<SID>
oracle.jdbc.driver.OracleDriver
Oracle OCI 9i
jdbc:oracle:oci:@<SID>
oracle.jdbc.driver.OracleDriver
To test your driver once it's installed, try the following code:
try
{
Class.forName("Driver name");
Connection con = DriverManager.getConnenction("jdbcurl","username","password");
//other manipulation using jdbc commands
}
catch(Exception e)
{
}