jsp 应用开发详解源代码 电子工业出版社
包含书中个源代码
源代码在线查看: tree.java
package extech.mis;
import java.sql.*;
public class tree {
String sDBDriver = "sun.jdbc.odbc.JdbcOdbcDriver";
String sConnStr = "jdbc:odbc:tree";
Connection conn = null;
ResultSet rs = null;
public tree() {
try {
Class.forName(sDBDriver);
}
catch(java.lang.ClassNotFoundException e) {
System.err.println(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.println(ex.getMessage());
}
return rs;
}
}