This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem geting column value.  RSS feed

 
Em Aiy
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Please look at the following code



This code is throwing exception ... "array index out of range". I have checked it and it comes only when i use rs (resultset object) to retrieve the value.
 
Herman Schelti
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Muhammad Ali,

I think int i should start with the value 1 (not with 0):

the JavaDoc for ResultSetMetaData says:
column - the first column is 1, the second is 2, ...

Herman
 
Em Aiy
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeah, one possible reason was that. The other reason was, i must have done "rs.next()" in order to get a value from the record.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!