/** * A simple sample to check the availability of scrollable result sets. * Please compare to ResultSet2.java ~ ResultSet6.java * * Please use jdk1.2 or later version */ import java.sql.*; public class ResultSet1 { public static void main(String[] args) throws SQLException { // Load the Oracle JDBC driver DriverManager.registerDriver(new oracle.jdbc.OracleDriver()); String url = "jdbc:oracle:oci8:@"; try { String url1 = System.getProperty("JDBC_URL"); if (url1 != null) url = url1; } catch (Exception e) { // If there is any security exception, ignore it // and use the default } // Connect to the database // You can put a database name after the @ sign in the connection URL. Connection conn = DriverManager.getConnection (url, "hr", "hr"); // Get the metadata regarding this connection's database DatabaseMetaData dbmd = conn.getMetaData(); // List all the possible result set types int resultset_types[] = { ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.TYPE_SCROLL_SENSITIVE }; // List all the possible result set concurrency types int concurrency_types[] = { ResultSet.CONCUR_READ_ONLY, ResultSet.CONCUR_UPDATABLE }; // List the result set type names String resultset_types_msg [] = { "Forward only", "Scroll insensitive", "Scroll sensitive" }; // List the concurrency type names String concurrency_types_msg[] = { "Read only", "Updatable" }; // Check the availability of the result type and concurrency type for (int i=0; i