aspose file tools*
The moose likes Servlets and the fly likes JDBC connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "JDBC connection" Watch "JDBC connection" New topic
Author

JDBC connection

Prabhleen Kaur
Greenhorn

Joined: May 31, 2002
Posts: 3
I am using JDBC connection to get the resultset. I am using same JDBC connection to update some records of same table. It is working. My question is:
Should I lock the connection when I do update or resultset.next()
If not, will resultset.next() give me correct data or there can be potential problem
L Goundalkar
Ranch Hand

Joined: Jul 05, 2001
Posts: 395
Hi,
You can use ResultSet.TYPE_SCROLL_SENSITIVE result sets to fetch data. But once it reads from the database, it can't see the changes made from other transactions.
So you can call the refreshRow() to get the latest data from the database.


<b>L G Goundalkar</b><br /> <a href="mailto:lggoundalkar@yahoo.com" rel="nofollow">lggoundalkar@yahoo.com</a> <br />Sun Certified Programmer for Java 2 Platform.<br />Sun Certified Web Component Developer for J2EE.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC connection
 
Similar Threads
JDBC connection query
Help - Data visibility in Weblogic and JDBC connection problem
JDBC connection query
Problem in accessing package variable through trigger
Hibernate and Jdbc