朗迪碳酸钙d3婴儿用量:select * from im_users where Id = '"+id+"' and password = '11' 那里错了?

来源:百度文库 编辑:查人人中国名人网 时间:2024/04/29 16:50:44
select * from im_users where Id = '"+id+"' password = '11' 那里错了?
select * from im_users where Id = '"+id+"' and password = '"+password+"'
报错
java.sql.SQLException: Illegal mix of collations (gb2312_chinese_ci,IMPLICIT) and (latin1_swedish_ci,COERCIBLE) for operation '='
到底那里错了?

select * from im_users where Id = '"+id+"' and password = '11'
另外如果你的ID字段是数值型的,就这样
select * from im_users where Id = "+id+" and password = '11'
记得多条件查询,各个条件之间要用and或者or连接。

一般你应该是做为一个字符串的。
比如;
sqlString = "select * from im_users where Id ='"+this.tbxID.Text+"'";
其他的同样参照

少了条件连接符