aspose file tools
The moose likes JDBC and the fly likes how to refresh resultset Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "how to refresh resultset" Watch "how to refresh resultset" New topic
Author

how to refresh resultset

Royal Scorpion
Greenhorn

Joined: Feb 15, 2004
Posts: 1
hi guys, i get an updatable resultset from a connection then used it to insert a new row but the result set doesn't chane after insertion, i mean the no of rows before insertion is the same after insertion and also the data, this is the code prove what i say

the display function body is
[code]
int currentRow = res.getRow();
res.first();
while (true)
{
System.out.println("CountyCode= " + res.getInt(1)); System.out.println("CountyName= " + res.getString(2));
if (!res.next())
break;
}
res.absolute(currentRow);
Please help me
N.B.
the type of resultset after creation it is res.getConcurrency() == ResultSet.CONCUR_UPDATABLE???
Thanks for your efforts
Seetesh Hindlekar
Ranch Hand

Joined: Feb 13, 2004
Posts: 244
Hi,
Cld be that the record inserted has not been committed!!!
Might as well use the connection.commit() to post the records after inserting.
Seetesh
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56155
    
  13

Welcome to the Ranch "Royal Scorpion"!
You'll find this forum a great place to seek help on JSP pages, and there aren't many rules you'll have to worry about, but one is that proper names are required. Please take a look at the JavaRanch Naming Policy and change your display name to match it.
In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.
Thanks!
bear
Forum Bartender


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to refresh resultset
 
Similar Threads
Vectors - please explain
How to implement the wall follower algorithm in java?
My JTable is a bit confused
Displaying a database table using Swing
Displaying a database table using Swing