import java.sql.*; import java.util.*; public class ConnectU { Connection con; ResourceBundle rbConnect; ResultSet rs; ResultSetMetaData rsmd; Statement stmt; // insert String variables here // end insert public ConnectU() { // insert code to Access the ResourceBundle and // retrieve the driver name, databaseURL, // userID and password here. // end insert try // Attempt to load the JDBC driver { // with newInstance // insert code to load the driver. // end insert } catch( Exception e ) // error { System.err.println( "Failed to load current driver."); return; } // end catch try { // insert code to Get a Connection, // get and report DBMS and driver info, // and create a Statement. // end insert } catch ( SQLException SQLe) { System.err.println( "problems connecting to " + sURL + ":" ); System.err.println( SQLe.getMessage() ); System.err.println( "SQL State: " + SQLe.getSQLState() ); if( con != null) { try { con.close(); } catch( Exception e ) {} } return; } // end catch try { // insert code to query data and // obtain and report metadata. // end insert } // end try catch (Exception e) { e.printStackTrace(); } finally { try { stmt.close(); } catch( Exception e ) {} try { con.close(); } catch( Exception e ) {} } // end finally clause } // end constructor public static void main (String args[]) { new ConnectU(); } // end main } // end class ConnectU