已采纳回答 / 慕粉3291149
完整的sql语句为 select * from imooc_goddess where user_name like '%name%'; <-------注意这里有单引号由于ptmt的映射机制,setString(1,name); 映射到sql语句中会自动添加单引号;如果像你说的这样 sql语句变成了select * from imooc_goddess where user_name like % 'name' %; <-----注意单引号的位置 很显然这样是错误的
2016-04-08
最赞回答 / yangpengboo
在GoddessAction中 add函数中添加goddess.setSex(1); goddess.setCreate_user("bobo"); goddess.setUpdate_user("bobo"); goddess.setIsdel(0);
2016-04-07
已采纳回答 / 疏影寒秋
我发现了 ,你在rs.next 下面没有 new Goddess 对象 导致 该对象为nullwhile(rs.next()){g=new Goddess ();}
2016-04-07
最新回答 / notmatter
我改成了图书的,你在稍微改一下就可以咯 else if(OPERATION_GET.equals(in.toUpperCase())||OPERATION_GET.substring(0,1).equals(in.toUpperCase())) { System.out.println("请输入要查询的图书的 [编号]"); Integer i=scan.nextInt(); try { ...
2016-04-06
最新回答 / 连宏伟HW
你导入的包有问题,必须是import java.sql.Connection;import java.sql.DriverManager;import java.sql.ResultSet;import java.sql.Statement;
2016-04-02