try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:jqb","bb","bb");
Statement sql=con.createStatement();
ResultSet rs;
if(ae.getSource()==b1)
{
String name1=t1.getText();String name2=t2.getText();
String name3=t3.getText();String name4=t4.getText();
if(name3.equals(name4))
{
/* rs=sql.executeQuery("select * from operator where username='"+name1+"' and mima='"+name2+"'");
if(rs.first())
{
sql.executeUpdate("update operator set mima='"+name3+"' where username='"+name1+"'");
JOptionPane.showMessageDialog(null,"修改成功");
t1.setText("");t2.setText("");t3.setText("");t3.setText("");t4.setText("");
}*///是不是这段验证有问题?
else
{
JOptionPane.showMessageDialog(null,"用户名不存在或密码错误!");
t1.setText("");t2.setText("");t3.setText("");t3.setText("");t4.setText("");
}
}
else
{
JOptionPane.showMessageDialog(null,"2次密码不一致!");
t3.setText("");t4.setText("");
}
}
else
{
this.dispose();
}
}
catch(Exception e1){System.out.println(e1);}
很简单的操作,但是老是出现异常,不知道错哪儿了,哪位大大帮忙看看,谢谢啦
[此贴子已经被作者于2007-3-21 21:17:08编辑过]