关于search 查询女神信息代码 问题
else if(OPERATION_SEARCH.equals(in.toUpperCase())
||OPERATION_SEARCH.substring(0,1).equals(in.toUpperCase())
||OPERATION_SEARCH.equals(previous)){
previous =OPERATION_SEARCH;
//查找
List<Map<String,Object>> params=new ArrayList<Map<String,Object>> ();
Map<String,Object> param=new HashMap<String,Object>();
if(step==1){
System.out.println("请输入的name:");
}else if(2==step){
param.put("name", in);
System.out.println("请输入的关系:");
}else if(3==step){
param.put("rela", in);
System.out.println("请输入的结果:");
}else if(4==step){
param.put("value", in);
params.add(param);
try {
List<Goddess> gs =action.query(params);
for(Goddess g:gs){
System.out.print(g.toString());
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
if(OPERATION_SEARCH.equals(previous)){
step++;
}
}
最后显示结果
select * from imooc_goddess where 1=1 and null null 3
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'null 3' at line 1
不知道最后sql为什么是null,不是传了值吗