swasti
swasti
Branch Unspecified
28 Oct 2007

JDBC Connection with DB2

Hi
i am a CSE student. i have completed core java, i am not able to graps a vast knowledge on JDBC connection.
so kindly give some notes, tips & tricks on JDBC which help me to developing some large project.

thank you.
Elisa

Elisa

Branch Unspecified
28 Oct 2007
swasti
Hi
i am a CSE student. i have completed core java, i am not able to graps a vast knowledge on JDBC connection.
so kindly give some notes, tips & tricks on JDBC which help me to developing some large project.

thank you.
Following might help

 Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
return DriverManager.getConnection("jdbc:odbc:" + databaseName, userId, password);
dhwanitsshah

dhwanitsshah

Branch Unspecified
30 Oct 2007
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:DSNname");
Statement st = con.createStatement();

e.g.->String sql="Select * from databasename";
St.executeUpdate(sql);
zeem_710

zeem_710

Branch Unspecified
06 Nov 2007
😎 Here is the code to connect JAVA and DB2

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc.odbc.DSN");

If your has a username and password, then provide the following:

DriverManager.getConnection("jdbc:odbc:DSN","user","password");

Add the path of IBM>db2>SQLLIB>BIN to the "path" environment variable(if u r working with Windows).
or, extract the "com" package from the src.zip file in bin folder of IBM DB2 to the folder where u have stored ur Java class file.
mlumanta

mlumanta

Branch Unspecified
04 Dec 2007
hi guys im new here., how are you?

Share this content on your social channels -

Only logged in users can reply.