//Put this at the beginning of your program private static final String DATABASE_FILE_NAME = "OfMiceAndMen.mdb"; // this is the usual dbcon system. private static final String DRIVER = "jdbc:odbc:DRIVER=" + "{Microsoft Access Driver (*.mdb)};" + "DBQ=" + new File (DATABASE_FILE_NAME).getAbsolutePath () + ";"; static { try { Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver"); } catch (ClassNotFoundException e) { System.out.println ("Class not found"); e.printStackTrace (); } } private Connection dbcon //put this in the method where you are running your query dbcon = DriverManager.getConnection (DRIVER); Statement stmt = dbcon.createStatement (); String sql = "SELECT Cue, lights, sound, projection, stagedir, ID FROM Cues WHERE ID = " + I + " "; //4 ResultSet rs = stmt.executeQuery (sql); while (rs.next ()) { String c = rs.getString ("Cue");// Cue is the name of the column being queried c = c + ""; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)