xml里读取元素active为true或者false
再将其转为sql脚本,因mysql里为active bit(1),
借用char类型
public static char change(String s){
if(s==null||"".equals(s))
return '\0';
if("true".equals(s))
return '\1';
if("false".equals(s))
return '\0';
return '\0';
}
拼SQL时:
sql+=...
"'"+javabean.getActive()+"',"
...