Created
April 9, 2011 13:02
Revisions
-
Mahkul created this gist
Apr 9, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ package database; import java.sql.*; public class BookDatabase { private String user = ""; private String password = ""; static String url = "jdbc:odbc:Books"; static Connection link; static Statement statement; static ResultSet results; public BookDatabase() { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); } catch(java.lang.ClassNotFoundException e) { System.err.print("ClassNotFoundException: "); System.err.println(e.getMessage()); } try { link = DriverManager.getConnection(url, user, password); statement = link.createStatement(); } catch(SQLException ex) { System.err.println("SQLException: " + ex.getMessage()); } } }