Basic HTML version of Foils prepared 7 October 97

Foil 52 Example - Using JDBC-ODBC Bridge - I

From Overview of JDBC and its use with Microsoft Access ARL Database Tutorial -- February 98. by Nancy McCracken(Sangetta Aggarwal, Udayan Parvate, Tom Pulikal)


import java.net.URL;
import java.sql.*;
class simpleselect {
public static void main (String args[]) {
String url = "jdbc:odbc:my-dsn";
String query = "SELECT * FROM emp";
try {
// Load the jdbc-odbc bridge driver
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
// Attempt to connect to a driver. Each one
// of the registered drivers will be loaded until
// one is found that can process this URL
// SEE NEXT FOIL!!



© on Mon Oct 13 1997