/ * JDBC-ODBC connection database * / package dbjavabean;
Import java.sql. *;
Public class officeb {
String sdbdriver = "sun.jdbc.odbc.jdbcodbcdriver"; string sconnstr = "jdbc: odbc: one"; connection conn = null; ResultSet RS = NULL;
Public openb () {try {class.forname (sdbdriver);} catch (java.lang.classnotnetfoundexception e) {system.err.print (E.GetMessage ());}}
public ResultSet executeQuery (String sql) {rs = null; try {conn = DriverManager.getConnection (sConnStr); Statement stmt = conn.createStatement (); rs = stmt.executeQuery (sql);} catch (SQLException ex) {System. Err.Print (ex.getMessage ());} Return Rs;}}