stmt=con.createStatement();出错
发布网友
发布时间:2023-07-09 09:41
我来回答
共3个回答
热心网友
时间:2023-10-03 01:10
stmt=con.createStatement();
应该是Statement stmt = con.createStatement();
ResultSet rs=stmt.executeQuery( "select*from t_user where username= ' "+un+ " ' and password= ' "+ps+ " ' ");
写成:
ResultSet rs=stmt.executeQuery( "select * from t_user where username= ' "+un+ " ' and password= ' "+ps+ " ' ");
热心网友
时间:2023-10-03 01:10
ResultSet rs=stmt.executeQuery( "select*from t_user where username= ' "+un+ " ' and
你把你的这句SQL 打印出来,看能不能在查询分析器中跑,我想是不能的
select * from 是要空格的,呵呵
热心网友
时间:2023-10-03 01:11
报异常了! 用try catch 包围就行了