Vamsi Pavan’s Place

When curiousity outbursts …..

J2EE Basics: JDBC Driver Connections

June 25th, 2010 · No Comments · Uncategorized

JDBC Driver Connection Method list

There are many version of the Friends to find JDBC driver or the driver often ask how to use, In here I simply sort out driver with more typical usage.

1. Microsoft SQL Server series (6.5, 7.x and 2000) and Sybase 10 Microsoft SQL Server series (6.5, 7.x and 2000) and Sybase 10

JDBC Name: jTDS
URL: http://jtds.sourceforge.net/
Version: 0.5.1
Download URL: http://sourceforge.net/project/showfiles.php?group_id=33291

Syntax:
CODE:

Class.forName(”net.sourceforge.jtds.jdbc.Driver”);
Connection con = DriverManager.getConnection(”jdbc:jtds:sqlserver://host:port/database”,”user”,”password”);

or

Connection con = DriverManager.getConnection(”jdbc:jtds:sybase://host:port/database”,”user”,”password”);

2. MySQL

JDBC Name: Connector/J 3.0
URL: http://www.mysql.com/
Version: 3.0.8-stable
Download URL: http://www.mysql.com/downloads/api-jdbc-stable.html

Syntax:

CODE:
Class.forName(”com.mysql.jdbc.Driver”);
Connection con = DriverManager.getConnection(”jdbc:mysql://host:port/database”,”user”,”password”);

3. Oracle

JDBC Name: Connector/J 3.0
URL: http://otn.oracle.com/
Version: 3.0.8-stable
Download URL: http://otn.oracle.com/software/tech/java/sqlj_jdbc/content.html

Syntax:

CODE:
Class.forName(”oracle.jdbc.driver.OracleDriver”);
Connection con = DriverManager.getConnection(”jdbc:oracle:thin:@host:port:databse”,”user”,”password”); 

4. Sybase

Driver: jConnect 4.5/5.5 (JDBC 2.0, use 5.5)

Syntax:

CODE:
Class.forName(”com.sybase.jdbc2.jdbc.SybDriver”).newInstance();
Connection con = DriverManager.getConnection (”jdbc: sybase: Tds: [IP address or machine name]: 2638? ServiceName = database name”, “account”, “password”);

5. Postgresql

JDBC Name: PostgreSQL JDBC
URL: http://jdbc.postgresql.org/
Version: 7.3.3 build 110
Download URL: http://jdbc.postgresql.org/download.html

Syntax:
CODE:

Class.forName(”org.postgresql.Driver”);
Connection con=DriverManager.getConnection(”jdbc:postgresql://host:port/database”,”user”,”password”);

6. Informix

Driver:com.informix.jdbc.IfxDriver Driver: com.informix.jdbc.IfxDriver

Syntax:
CODE:

Class.forName(”com.informix.jdbc.IfxDriver”);
String full_db=”jdbc:informix-sqli://10.14.86.11:300/authority: INFORMIXSERVER=ifx9;user=informix;password=informix;NEWLOCALE=en_us,zh_tw;NEWCODESET=Big5,8859-1,819;”; String full_db = “jdbc: informix-sqli: / / 10.14.86.11:300 / authority: INFORMIXSERVER = ifx9; user = informix; password = informix; NEWLOCALE = en_us, zh_tw; NEWCODESET = Big5 ,8859-1, 819;”;
con =DriverManager.getConnection(full_db); con = DriverManager.getConnection (full_db);

7. IBM AS400 mainframe in the use of JDBC syntax

Have installed V4R4 or later of Client Access Express
Can be C:\Program Files\IBM\Client Access\jt400\lib
Find the driver files jt400.zip, and change the file name as jt400.jar

Grammar
CODE:

java.sql.DriverManager.registerDriver (new com.ibm.as400.access.AS400JDBCDriver ());
Class.forName(”com.ibm.as400.access.AS400JDBCConnection”); 
con = DriverManager.getConnection(”jdbc:as400://IP”,”user”,”password”);

List will be updated as we go ahead, don’t forget to check the updated one.

Bookmark it! These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • StumbleUpon
  • BlinkList
  • YahooMyWeb
  • NewsVine
  • blogtercimlap
  • Netvouz
  • Technorati
  • Slashdot
  • Print this article!

Tags:

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment