[急]Please help me,what's wrong?
以一是我的一个实现查询,删除,修改功能的程序中的查询部分程序,其中ljz是我数据库中建的一个表,这个功能实现不了,操作是一直说"抱歉,程序出现异常!"帮忙看一那儿错了? //查找功能的实现
if(e.getSource()==subMenu2[0]||e.getSource()==toolBarButton[0])
{
String idid = JOptionPane.showInputDialog("请输入要查找的学生学号");
if(idid.trim()!="")
{
String strSQL = "select * from ljz where id ='" + idid + "'";
try
{
//rs = st.executeQuery("select * from ljz where id ='2005162010'");
rs = st.executeQuery(strSQL);
int count = 0;
while(rs.next())
{
id = rs.getString("id");
name = rs.getString("name");
department = rs.getString("department");
sex = rs.getString("sex");
birthday = rs.getString("birthday");
nation = rs.getString("nation");
++count;
}
if(count==0)
JOptionPane.showMessageDialog(null,"对不起,没有您要查找的学生!");
else
{
idT.setText(id);
nameT.setText(name);
sexT.setText(sex);
birthdayT.setText(birthday);
nationT.setText(nation);
departmentT.setText(department);
}
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(null,"抱歉,程序出现异常!");
}
}
}
[[italic] 本帖最后由 ljz453780909 于 2007-12-4 16:02 编辑 [/italic]]