L
lanren
Unregistered / Unconfirmed
GUEST, unregistred user!
1.我的applet在ie中运行显示错误:java.lang.NoClassDefFoundError:com/borland/dx/dataset/DataSet
但我的classpath中分明是设置了这个类包,而且其它不带数据库操作的applet在ie中运行正常。
2.这段代码运行正常,
class....{ System.setProperty"jdbc.drivers","oracle.jdbc.driver.OracleDriver");
con=DriverManager.getConnection"jdbcracle:thin192.168.1.102:1521ra8",username ,password );
stmt=con.createStatement();
String sql="select * from ycb.kqbmk";
rs=stmt.executeQuery(sql);
while(rs.next())
{
jComboBox2.addItem(rs.getString(1));
}
sql="select * from ycb.kqdak where bm='高研所'";
rs=stmt.executeQuery(sql);
while(rs.next())
jComboBox3.addItem(rs.getString(2));
for(int i=1;i<=12;i++)
{jComboBox1.addItem(i+"月份");
}
}
private Connection con;
private Statement stmt;
private ResultSet rs;
}
但是如果把这一部分放到事件处理中
void jComboBox2_actionPerformed(ActionEvent e) {
sql="select * from ycb.kqdak where bm='高研所'";
rs=stmt.executeQuery(sql);
while(rs.next())
jComboBox3.addItem(rs.getString(2));
}则编译错误,提示unreport sqlexception;
为什么?
但我的classpath中分明是设置了这个类包,而且其它不带数据库操作的applet在ie中运行正常。
2.这段代码运行正常,
class....{ System.setProperty"jdbc.drivers","oracle.jdbc.driver.OracleDriver");
con=DriverManager.getConnection"jdbcracle:thin192.168.1.102:1521ra8",username ,password );
stmt=con.createStatement();
String sql="select * from ycb.kqbmk";
rs=stmt.executeQuery(sql);
while(rs.next())
{
jComboBox2.addItem(rs.getString(1));
}
sql="select * from ycb.kqdak where bm='高研所'";
rs=stmt.executeQuery(sql);
while(rs.next())
jComboBox3.addItem(rs.getString(2));
for(int i=1;i<=12;i++)
{jComboBox1.addItem(i+"月份");
}
}
private Connection con;
private Statement stmt;
private ResultSet rs;
}
但是如果把这一部分放到事件处理中
void jComboBox2_actionPerformed(ActionEvent e) {
sql="select * from ycb.kqdak where bm='高研所'";
rs=stmt.executeQuery(sql);
while(rs.next())
jComboBox3.addItem(rs.getString(2));
}则编译错误,提示unreport sqlexception;
为什么?