If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > problem in updation of Row in DB2 using updateRow method

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-18-07, 00:35
g_sri1987 g_sri1987 is offline
Registered User
 
Join Date: Oct 2007
Posts: 5
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
Reply With Quote
  #2 (permalink)  
Old 10-18-07, 10:45
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
As was suggested in your other thread on this topic, we suggest that you use the DB2 JDBC driver.

Andy
Reply With Quote
  #3 (permalink)  
Old 10-18-07, 13:52
g_sri1987 g_sri1987 is offline
Registered User
 
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???
Reply With Quote
  #4 (permalink)  
Old 10-18-07, 14:05
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On