wood burning stoves 2.0*
The moose likes JDBC and the fly likes Using populate in CachedRowSet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Using populate in CachedRowSet" Watch "Using populate in CachedRowSet" New topic
Author

Using populate in CachedRowSet

renu richard
Ranch Hand

Joined: Oct 06, 2008
Posts: 116
Hi,
In my application, i am reading the data from the database and then displaying it in another JSP.

In program 1, i am calling the executeQuery method, which is getting the connection object and then exectuing the query.


Program 2 shows how the executeQuery method is defined.


Now the problem is, eventhough aoCRS.size() is retuning size as 1, the line loRS.next() is not getting executed and the it is going to the else part.
Could you please help me on this.

[ November 10, 2008: Message edited by: renu richard ]
[ November 10, 2008: Message edited by: renu richard ]

Cheers,
Richard
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1081

Did you check how many rows are there in resultset, also you can refer one example here http://ilovej2ee.blogspot.com/2008/01/using-cachedrowset-in-java.html

Shailesh


Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
renu richard
Ranch Hand

Joined: Oct 06, 2008
Posts: 116
Hi Shailesh,
Thanks for that wonderful example.
The problem in my code was that for debugging i have used next method somewhere already in my application. So, when i tried using the next method again it is called again but there are no rows to execute. Thats why it failed.
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1081

glad to know that you found the problem

Shailesh
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using populate in CachedRowSet