Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2007
    Posts
    5

    Unanswered: problem in updation of Row in DB2 using updateRow method

    hello sir,
    I have never worked with DB2.I am facing a problem with updation of row in DB2.The following piece of code is not working in DB2...but works fine for MSAccess and Oracle.

    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con1=DriverManager.getConnection ("jdbcdbc:tgmc","db2admin","laptop");
    Statement stmt1 = con1.createStatement(ResultSet.TYPE_SCROLL_SENSITI VE,ResultSet.CONCUR_UPDATABLE);
    ResultSet rs = stmt1.executeQuery("select * from \"GAURAV SRIVASTAVA\".form");
    while(rs.next())
    {
    int f_id=rs.getInt("form_id");
    if(f_id==11)
    {
    rs.updateString("status","ri");//here is the problem
    rs.updateRow();
    }
    }
    con1.close();

    The above code throws NullPointerExecption.
    Can you help me with this error??? Or can you suggest me an appropiate method for performing the task

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    As was suggested in your other thread on this topic, we suggest that you use the DB2 JDBC driver.

    Andy

  3. #3
    Join Date
    Oct 2007
    Posts
    5
    i am using IBM DB2 ODBC DRIVER - DB2COPY1.
    thats the driver provided in Window's XP.Is it the driver thats creating the problem??? Can u provide me some links from where I can get the DB2 JDBC driver???

  4. #4
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Did you load the DB2 client software on the computer? If so, you already have the jdbc driver. They will be located in C:\program files\ibm\sqllib\java

    Andy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •