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.

Replies

  • Elisa
    Elisa
    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
    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
    😎 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
    hi guys im new here., how are you?

You are reading an archived discussion.

Related Posts

hi..i want to know about torrents...what are these..... how to download them...and every possible infomation possible.. actually i visite da website mininova.org..i was trying to download some torrent ..but whenever...
dear friends i m new member looking for ur fast help i need information about the reaction of chlorine and methane in wastewater treatment
hi everyone... i hv recntly joined d gang of "d crazy engg". wl,can anybody of u can help me wth sum easiest code for the following conversions in STACK. 1....
Which is the good book for electrical science and engineering chemistry for b tech 1st and 2nd semester
hello friends, could any one of you tell me how to protect a folder/file using DOS ? 😁Thanks in advance for you answers.😁