String sql=“select * from user where username=? And password=?”;
user属于sql里的关键字,所以会报错,一般不要用关键字作为表名,如果关键字做表名用[]括起来,
String sql=“select * from [user] where username=? And password=?”;
select * from [user] where id=? and password=?"
试试看。
sqlserver有个系统表叫 user
业精于勤荒于嬉,行成于思毁于随。