关键代码:
String sql="select * from NET where title like '%asp%'";
rs=stmt.executeQuery(sql);
打印:while(list.next()){out.println(list.getString(2));}
如果把where title like '%asp%'去掉可以打印成功,这个table的第二段字段是string类型的asp.net。现在为什么打印不出来?求教啊,大侠帮帮忙。
String sql="select * from NET where title like '%asp%'";
rs=stmt.executeQuery(sql);
打印:while(list.next()){out.println(list.getString(2));}
如果把where title like '%asp%'去掉可以打印成功,这个table的第二段字段是string类型的asp.net。现在为什么打印不出来?求教啊,大侠帮帮忙。
构造SQL 语句:String sql = "select id,name,age,gender,birth from student where name like ?"; 参数设值:PreparedStatement ps = conn.PreparedStatement(sql);String str = getName();ps.setString(1,"%" + str + "%");
如果是表名那应该没问题的