• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ResultSet Update problem with Oracle 9i using JDBC

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am using a sample JDBC code to connect to Oracle 9i.The following code snippet is being used:

Connection conn = DriverManager.getConnection
("jdbc racle ci8:@DXDB", "dxo", "dxo");

PreparedStatement stmt = conn.prepareStatement("select userid,keydata,description from dxo.user",
ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE);
ResultSet rset = stmt.executeQuery();
rset.moveToInsertRow();


rset.updateInt(1,16);
rset.updateString(2, "testdatakey");
rset.updateString(3, "testdata for Oracle connection");
rset.insertRow();

rset.moveToCurrentRow();
 
Rupa S
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry the previous post was incomplete.

The code being used is causing some problems.When i iterate through the resultset to print all the rows of the table, the resultset does not have the data of newly inserted row.
Everytime it shows all the data except the freshly inserted data. This is causing problems in my application as the newly inserted data is not shown.

I explored web for this, everywhere its said that this kind of insertion mechansim using ResultSet object updates the ResultSet as well as the underlying database.
But in my case the ResultSet does not show the new data, where as the database has the newly inserted row.

Please help me in resolving this issue.

Thanks in advance.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic