文档介绍:×÷Õߣºwebwing
email: webwing@
ÈÕÆÚ£º2001-1-12 11:24:45
//java bean
//file name:
import .*;
public class faq {
String sDBDriver = "";
String sConnStr = "jdbc:odbc:faq";
Connection conn = null;
ResultSet rs = null;
public faq() {
try {
(sDBDriver);
}catch( e) {
("faq(): " + ());
}
}
public ResultSet executeQuery(String sql) {
rs = null;
try {
conn = (sConnStr);
Statement stmt = ();
rs = (sql);
}catch(SQLException ex) {
(": " + ());
}
return rs;
}
}
//java Application
//file name:
import .*;
class getRs
{
public static String Answer;
public static String Subject;
public static String[][] rsArray = new String[9][2];;
public static int n = 0;
getRs(){
try {
faq workM = new faq();
ResultSet oRs = ("SELECT * FROM faq");
//(());
while (()){
(("Answer"));
(("Subject"));
n=n+1;
}
}catch (SQLException ex)
{
("error:"+ex);
}
}
}
public class testfaq {
public static void main(String[] args) {
getRs