* GREY=local LOCAL HTML version of Foils prepared 13 March 1997

Foil 22 Example - Using JDBC-ODBC Bridge - I

From Overview of Java Database Connection Basic Information Technology Course CPS616 -- Spring Semester 1997. by Udayan Parvate, Tom Pulikal (Geoffrey C. Fox) *

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!!



Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Tue Jul 22 1997