Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

store recordset into array

 
Yudi Ono
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi.

how to store recordset result into array?


thanks

regards

yudi




 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you say recordset, do you mean java.sql.ResultSet? If so, you need to iterate through the ResultsSet and for each row create an appropriate wrapper object (somehtign that encapsultes all the properties of the row), assign this object the values in the row then add it to the array.
 
Yudi Ono
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you paul for the quick reply.

yes you are correct paul..java.sql.ResultSet is what i mean.

i have a result set like this.


could you please give me the example code?

thanks and regards


yudi
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is quite a detailed explanation in the JDBC tutorial (including examples). I suggest you have a read through that, you should find it useful.
 
Campbell Ritchie
Sheriff
Posts: 48923
58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like a thread which would sit better in the JDBC forum. Moving.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic