aspose file tools*
The moose likes JDBC and the fly likes gettting value by column name vs index Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "gettting value by column name vs index" Watch "gettting value by column name vs index" New topic
Author

gettting value by column name vs index

rudra tripathy
Greenhorn

Joined: May 26, 2004
Posts: 25
Hi All,

Should we use rs.getString("columnname") or rs.getString(columnindex) and which one is fatser?
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Faster is neither here nor there.

Name is safer. If you change the order of fields in your select statement your index based logic is broken.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
rudra tripathy
Greenhorn

Joined: May 26, 2004
Posts: 25
Thanks for the reply. Yeah.. Our architect is trying to push for column index and he claimed it is faster by column index. Tried googling, but couldn't get any definite answer for this.

Thannks
Rdura
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60057
    
  65

Ask for proof.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
wood burning stoves
 
subject: gettting value by column name vs index
 
Similar Threads
query returning null
String to decimal?
java.sql.Timestamp to Oracle date
how to display more than one result from the db..
how to get values in an object?