import java.io.*; import java.sql.*; /** * Gets a database connection, closes it. */ public class MakeConnection { public static void main(String[] args) { Connection conn = null; // Load the database driver. try { Class.forName("ORG.as220.tinySQL.textFileDriver"); } catch (ClassNotFoundException e) { System.out.println("Driver class was not found."); return; } // end try block // Connect to the database, note that username and password are not // required in this case. try { conn = DriverManager.getConnection("jdbc:tinySQL", "", ""); System.out.println("Connection open."); } catch (SQLException eSQL) { System.out.println(eSQL.getMessage()); return; } finally { try { conn.close(); System.out.println("Connection closed."); } catch (Exception e) {} } // end try } // end main } // MakeConnection