aspose file tools*
The moose likes JDBC and the fly likes questions about statement types and performace . 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 » Databases » JDBC
Bookmark "questions about statement types and performace ." Watch "questions about statement types and performace ." New topic
Author

questions about statement types and performace .

raminaa niilian
Ranch Hand

Joined: Jul 14, 2005
Posts: 550
Which type of result set has best performace for a read only purpose ?
is it wise to use

ResultSet.TYPE_SCROLL_INSENSITIVE , ResultSet.CONCUR_READ_ONLY
i just want to retrive one column of one record (my query will return just one record)

thank you
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29275
    
140

Raminaa,
ResultSet.TYPE_FORWARD_ONLY , ResultSet.CONCUR_READ_ONLY is best here. You don't need any scrolling capability or to update the data.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18152
    
    8

That's true. Personally I only ever use forward-only, read-only result sets. However if your query is only returning one record, the choice is going to make almost no difference in practice.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: questions about statement types and performace .
 
Similar Threads
Whats the difference in Statement and PreperedStatement ?
core java optimization
Files vs Arrays?
the property "hibernate.hbm2ddl.auto"
why would somebody do that??