Database Drivers and Connection Strings for various popular Database products: MySQL: Driver : "org.gjt.mm.mysql.Driver" and "com.mysql.jdbc.Driver" Connection String : "jdbc:mysql://Server_name:Port_number/Database_name? user=user_name&password=password_string" Server_name : Default: localhost Other ex: www.yourDomain.com, www.abc.com Port_number : default : 3306(you know it by running "MySQLInstanceConfig.exe" utility) Database_name : Name of the database to which you want to connect
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: Driver : Type 2 Driver ---> "COM.ibm.db2.jdbc.app.DB2Driver" and Type 4 Driver(Net driver) ---> "com.ibm.db2.jcc.DB2Driver" Connection String : Type 2 ---> "jdbc:db2:Database_name" Type 4 ---> "jdbc:db2://Server_name:Port_number/Database_name" Server_name : Default: localhost Other ex: www.yourDomain.com, www.abc.com Port_number : default : 50000 (you know at the time of db2 installation, it prompts you for a port number) Database_name : Name of the database to which you want to connect
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
A List of JDBC Drivers If you need to access a database with Java, you need a driver. This is a list of the drivers available, what database they can access, who makes it, and how to contact them. IBM DB2 jdbc:db2://
:/ COM.ibm.db2.jdbc.app.DB2Driver <-- Type 2 com.ibm.db2.jcc.DB2Driver <-- Type 4 JDBC-ODBC Bridge jdbc:odbc: sun.jdbc.odbc.JdbcOdbcDriver Microsoft SQL Server jdbc:weblogic:mssqlserver4:@: weblogic.jdbc.mssqlserver4.Driver Oracle Thin jdbc:oracle:thin:@::<SID> oracle.jdbc.driver.OracleDriver PointBase Embedded Server jdbc:pointbase://embedded[:]/ com.pointbase.jdbc.jdbcUniversalDriver Cloudscape jdbc:cloudscape: COM.cloudscape.core.JDBCDriver Cloudscape RMI jdbc:rmi://:/jdbc:cloudscape: RmiJdbc.RJDriver Firebird (JCA/JDBC Driver)
jdbc:firebirdsql:[//[:]/] org.firebirdsql.jdbc.FBDriver IDS Server jdbc:ids://:/conn?dsn='' ids.sql.IDSDriver Informix Dynamic Server jdbc:informixsqli://:/:INFORMIXSERVER=<SERVER_NAME> com.informix.jdbc.IfxDriver InstantDB (v3.13 and earlier) jdbc:idb: jdbc.idbDriver InstantDB (v3.14 and later) jdbc:idb: org.enhydra.instantdb.jdbc.idbDriver Interbase (InterClient Driver) jdbc:interbase:/// interbase.interclient.Driver Hypersonic SQL (v1.2 and earlier) jdbc:HypersonicSQL: hSql.hDriver Hypersonic SQL (v1.3 and later) jdbc:HypersonicSQL: org.hsql.jdbcDriver Microsoft SQL Server (JTurbo Driver) jdbc:JTurbo://:/ com.ashna.jturbo.driver.Driver Microsoft SQL Server (Sprinta Driver) jdbc:inetdae::?database= com.inet.tds.TdsDriver Microsoft SQL Server 2000 (Microsoft Driver) jdbc:microsoft:sqlserver://:[;DatabaseName=] com.microsoft.sqlserver.jdbc.SQLServerDriver MySQL (MM.MySQL Driver) jdbc:mysql://:/ org.gjt.mm.mysql.Driver com.mysql.jdbc.Driver Oracle OCI 8i
jdbc:oracle:oci8:@<SID> oracle.jdbc.driver.OracleDriver Oracle OCI 9i jdbc:oracle:oci:@<SID> oracle.jdbc.driver.OracleDriver PostgreSQL (v6.5 and earlier) jdbc:postgresql://:/ postgresql.Driver PostgreSQL (v7.0 and later) jdbc:postgresql://:/ org.postgresql.Driver Sybase (jConnect 4.2 and earlier) jdbc:sybase:Tds:: com.sybase.jdbc.SybDriver Sybase (jConnect 5.2) jdbc:sybase:Tds:: com.sybase.jdbc2.jdbc.SybDriver 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) { }