sweet dreams
sweet dreams

Reputation: 2134

What does a ResultSet object look like?

Is it like an array or is it like a database/excel table ? Or something else ?

Upvotes: 0

Views: 1568

Answers (3)

Manuel Selva
Manuel Selva

Reputation: 19050

I think the best way to know that is to look at the javadoc here

http://docs.oracle.com/javase/6/docs/api/java/sql/ResultSet.html

In the javadoc you have code sample to get and use such objects.

Upvotes: 3

Zoop
Zoop

Reputation: 656

Taken from javadocs:

A table of data representing a database result set, which is usually generated by executing a statement that queries the database.

http://docs.oracle.com/javase/6/docs/api/java/sql/ResultSet.html

Upvotes: 1

Tomasz Nurkiewicz
Tomasz Nurkiewicz

Reputation: 340993

It is JDBC driver dependant, ResultSet is just an interface. But in principle the closest you can get is an Iterator. ResultSet gives you one result at a time and allows to query whether there are any more results. Theoretically ResultSet can fetch one record at a time as well.

Upvotes: 1

Related Questions