A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
forum!
JavaRanch
»
Java Forums
»
Databases
»
JDBC
Author
gettting value by column name vs index
rudra tripathy
Greenhorn
Joined: May 26, 2004
Posts: 24
posted
Sep 02, 2010 04:00:03
0
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
I like...
posted
Sep 02, 2010 04:12:16
0
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: 24
posted
Sep 02, 2010 23:28:28
0
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: 56202
13
I like...
posted
Sep 02, 2010 23:45:36
0
Ask for proof.
[
Smart Questions
] [
JSP FAQ
] [
Books by Bear
] [
Bear's FrontMan
] [
About Bear
]
I agree. Here's the link:
http://ej-technologies/jprofiler
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: gettting value by column name vs index
Similar Threads
how to display more than one result from the db..
java.sql.Timestamp to Oracle date
query returning null
how to get values in an object?
String to decimal?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter