Top "Resultset" questions

A result set is a set of rows from a database, which is usually generated by executing a statement that queries the database.

JDBC ResultSet: I need a getDateTime, but there is only getDate and getTimeStamp

I would like to get the DATETIME column from an Oracle DB Table with JDBC. Here is my code: int …

java sql oracle resultset getdate
How to find whether a ResultSet is empty or not in Java?

How can I find that the ResultSet, that I have got by querying a database, is empty or not?

java jdbc resultset
Mapping a JDBC ResultSet to an object

I have a user class that has 16 attributes, things such as firstname, lastname, dob, username, password etc... These are all …

java mysql object jdbc resultset
What does "if (rs.next())" mean?

I am currently getting the error, java.sql.SQLException: Method 'executeQuery(String)' not allowed on prepared statement. because I …

java string prepared-statement resultset sqlexception
Trying to get the average of a count resultset

I have the following SQL:(bitemp) SELECT COUNT (*) AS Count FROM Table T WHERE (T.Update_time = (SELECT MAX (B.…

sql count db2 resultset average
ResultSet: Retrieving column values by index versus retrieving by label

When using JDBC, I often come across constructs like ResultSet rs = ps.executeQuery(); while (rs.next()) { int id = rs.getInt(1); // …

java optimization jdbc resultset maintenance
Can a JPA Query return results as a Java Map?

We are currently building a Map manually based on the two fields that are returned by a named JPA query …

dictionary jpa resultset openjpa
Java Iterator backed by a ResultSet

I've got a class that implements Iterator with a ResultSet as a data member. Essentially the class looks like this: …

java sql jdbc iterator resultset
How do I get the row count in JDBC?

I've executed a JDBC query to obtain a resultset. Before iterating over it, I'd like to quickly find out how …

java jdbc resultset
Getting java.sql.SQLException: Operation not allowed after ResultSet closed

When I execute the following code, I get an exception. I think it is because I'm preparing in new statement …

java mysql jdbc prepared-statement resultset