CrazyEngineers
  • swasti
    swasti

    MemberOct 28, 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.
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • Elisa

    MemberOct 28, 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);
    Are you sure? This action cannot be undone.
    Cancel
  • dhwanitsshah

    MemberOct 30, 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);
    Are you sure? This action cannot be undone.
    Cancel
  • zeem_710

    MemberNov 5, 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.
    Are you sure? This action cannot be undone.
    Cancel
  • mlumanta

    MemberDec 3, 2007

    hi guys im new here., how are you?
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register