我已经创建好数据库zhouonline,数据库以及password1表,但我提交的aa与在数据库查询的判断不成功!!(如:aa赋值为admin,password1表的第一列名为帐号以为有值为admin),但并没有返回成功或者失败的提示)
请高手求教!!!!
import java.awt.*;
import javax.swing.*;
import java.sql.*;
public class bb 
{
public static void main(String args[])
{
String url="jdbc:odbc:zhouonline";
String sql="SELECT * FROM password1 where 帐号=?";
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con=DriverManager.getConnection(url);
    PreparedStatement  pst=con.prepareStatement(sql);
    String aa=JOptionPane.showInputDialog(null,"aad");
    pst.setString(1,aa);
    ResultSet rs=pst.executeQuery();
    while(rs.next())
    {
      if(aa.equals(rs.getString(1)))
      JOptionPane.showMessageDialog(null,"成功");
      else
      JOptionPane.showMessageDialog(null,"失败");
     
    }
}
catch(Exception e)
{
  JOptionPane.showMessageDialog(null,e);
}

}
}