aspose file tools*
The moose likes JDBC and the fly likes ResultSet Update problem with Oracle 9i using JDBC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "ResultSet Update problem with Oracle 9i using JDBC" Watch "ResultSet Update problem with Oracle 9i using JDBC" New topic
Author

ResultSet Update problem with Oracle 9i using JDBC

Rupa S
Greenhorn

Joined: Dec 08, 2004
Posts: 10
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

Joined: Dec 08, 2004
Posts: 10
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ResultSet Update problem with Oracle 9i using JDBC
 
Similar Threads
Oracle JDBC connection in a servlet
ORA-01000: maximum open cursors exceeded
where to copy classes111.zip in tomcat ?
What happens when you read large blob data from Oracle db using jdbc connection?
Connection Establishment problem with Oracle