String sql = "select * from record where choice like '"+%gjz%+"' and date >= '"+sdate+"' and date <='"+edate+"' order by date ";
ResultSet rs=stmt.executeQuery(sql);
'"+%gjz%+"'没有错
String sql = "select * from record where ('"+choice+"' like '%"+gjz+"%') and date >= '"+sdate+"' and date <='"+edate+"' order by date ";
百分号的位置的问题吧 另外choice是不固定的列名吗,要是固定的不用写成参数吧
"select * from record where ('"+choice+"' like '"+%gjz%+"') and date
改成
"select * from record where ("+choice+" like '%"+gjz+"%') and date
这样就行了
String sql = "select * from record where choice like '"+%gjz%+"' and date >= '"+sdate+"' and date <='"+edate+"' order by date ";
我猜你那个choice不是传的参吧?