Author
ResultSet to Array
Srinivasa Maddi
Ranch Hand
Joined: Apr 18, 2007
Posts: 60
posted Nov 03, 2008 04:56:00
0
How can i convert a ResultSet to an array of String values. I tried the following
Shailesh Chandra
Ranch Hand
Joined: Aug 13, 2004
Posts: 1076
What is the datatype of column, which you are expecting to retrieve as array ? Shailesh
Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
Srinivasa Maddi
Ranch Hand
Joined: Apr 18, 2007
Posts: 60
posted Nov 03, 2008 05:04:00
0
String
Shailesh Chandra
Ranch Hand
Joined: Aug 13, 2004
Posts: 1076
I am not sure but probably you are looking for this. Shailesh
steve souza
Ranch Hand
Joined: Jun 26, 2002
Posts: 852
'getString' returns a String and you are assigning it to an ayrray. You should allocate a String[] array for each and loop through it for the columns, assigning the string to the different elements of the array.
http://www.jamonapi.com/ - a fast, free open source performance tuning api.
JavaRanch Performance FAQ
Srinivasa Maddi
Ranch Hand
Joined: Apr 18, 2007
Posts: 60
posted Nov 04, 2008 00:11:00
0
Thank you all for responding
Jack Bolton
Ranch Hand
Joined: May 08, 2006
Posts: 65
Shailesh Chandra wrote: I am not sure but probably you are looking for this.
Shailesh
with this code, the options array has all the values from the resultset.
but if i do this:
i got:
null
1
null
when in fact it should be the values from the database that the resultset had.
whats going on here?>
subject: ResultSet to Array