I want to know about the implementation of
ResultSet rs=cn.executeQuery();
rs.next();
now where next is implemented.
I can not find where my ResultSet
interface next() method implementation available in JDBC.
I want to know about the implementation of
ResultSet rs=cn.executeQuery();
rs.next();
now where next is implemented.
I can not find where my ResultSet
interface next() method implementation available in JDBC.
All database should support common operations of executing a query, traverse through the resultset, reading each column in a result, getting a connection,closing a connection ...etc.
So these standard operations are made as interface methods by Java. ow the vendors who provide database drivers, implement this interface and hence they have to write their own implementation for each methods.
so you can find implementation in a jar that you are using for database connection like sqljdbc, odbc etc.
ResultSet
is a interface, It doesn't have any method implementation.
You need to see the implemented classes.
ResultSet
is an interface for supporting all the common database operations.
Different vendors such as Oracle, MySQL, HSQLDB
all have implemented their own drivers which contain the actual vendor specific implementation.
These drivers are present in the form of jars
which you have to add to your project classpath to be able to communicate with that vendor specific database.
your question is not clear but i give some code try this :
String query = "SELECT * from sss;
ResultSet rs = stmt.executeQuery(query);
while(rs.next())
{
String xx = rs.getString("x");
}