Thursday, October 2, 2014

2.13 ResultSetMetaData


2.13 ResultSetMetaData

-          (java.sql) Interface ResultSetMetaData :

-          Also Known Subinterfaces:  RowSetMetaData
-          public interface ResultSetMetaData.
-          An object that can be used to get information about the types and properties of the columns in a ResultSet object.
-          The following code fragment creates the ResultSet object rs.
-          Creates the ResultSetMetaData object rsmd.
-          And uses rsmd to find out how many columns rs has.
-          And whether the first column in rs can be used in a WHERE clause.

-          ResultSet rs = stmt.executeQuery("SELECT a, b, c FROM TABLE2");
-          ResultSetMetaData rsmd = rs.getMetaData();
-          int numberOfColumns = rsmd.getColumnCount();
-          boolean b = rsmd.isSearchable(1);
 

No comments:

Post a Comment