Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

gettting value by column name vs index

 
rudra tripathy
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Should we use rs.getString("columnname") or rs.getString(columnindex) and which one is fatser?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
rudra tripathy
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64683
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ask for proof.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic