FNProgramvare :: View topic - Help developing add-ons

FNProgramvare :: View topic - Help developing add-ons: "For a DSN-Less Connection you could open a MS-Access database in
JAVA with JDBC as follows

final String myDatabaseFile = 'C:/Data/CATraxx.mdb';
// Try to obtain the database connection
Class.forName('sun.jdbc.odbc.JdbcOdbcDriver');
Connection myConn = DriverManager.getConnection('jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=' myDatabaseFile, '', '');

After that you can access the database via the myConn Connection.
For example to read the entire Album table in CATraxx:

final String sql 'SELECT * FROM Album';
Statement statement = myConn.createStatement();
ResultSet rs = statement.executeQuery(sql);

// Read the resultset
while (rs.next()) {
........
........
} "

沒有留言:

張貼留言

注意:只有此網誌的成員可以留言。