aspose file tools*
The moose likes JDBC and the fly likes ResultSet to Array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "ResultSet to Array" Watch "ResultSet to Array" New topic
Author

ResultSet to Array

Srinivasa Maddi
Ranch Hand

Joined: Apr 18, 2007
Posts: 60
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: 1081

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
String
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1081

I am not sure but probably you are looking for this.



Shailesh
steve souza
Ranch Hand

Joined: Jun 26, 2002
Posts: 860
'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
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?>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ResultSet to Array