Struts DB查询执行错误
我正在尝试使用 struts 1.3 将数据从 IBM RAD 7.5 插入到我的 db2 9.7 数据库 但是,当我执行查询时,出现以下错误: http://pastebin.com/3UPTVKbh
KayitBean kayit=(KayitBean)form;
//String name = kayit.getName();
String name="endee";
DBConn hb = new DBConn();
Connection conn =hb.getConnection();
System.out.println("basarili");
//String sql = "SELECT * FROM ENDER.\"MEKANDENEME\"";
String sql = "INSERT INTO ENDER.\"MEKANDENEME\" VALUES (\'endere\' ,\'bos\');";
System.out.println(sql);
System.out.println("basarili2");
PreparedStatement ps = conn.prepareStatement(sql);
System.out.println("basarili3");
ResultSet rs = ps.executeQuery();
// String ender=rs.getArray(1).toString();
System.out.println("basarili4");
// System.out.println(rs);
conn.close();
我收到此消息在 System.out.println("basarili3");" 之后 请帮我。
I am trying to insert a data to my db2 9.7 database from IBM RAD 7.5 using struts 1.3
But when I execute the query I got this errors: http://pastebin.com/3UPTVKbh
KayitBean kayit=(KayitBean)form;
//String name = kayit.getName();
String name="endee";
DBConn hb = new DBConn();
Connection conn =hb.getConnection();
System.out.println("basarili");
//String sql = "SELECT * FROM ENDER.\"MEKANDENEME\"";
String sql = "INSERT INTO ENDER.\"MEKANDENEME\" VALUES (\'endere\' ,\'bos\');";
System.out.println(sql);
System.out.println("basarili2");
PreparedStatement ps = conn.prepareStatement(sql);
System.out.println("basarili3");
ResultSet rs = ps.executeQuery();
// String ender=rs.getArray(1).toString();
System.out.println("basarili4");
// System.out.println(rs);
conn.close();
I am receiving this after System.out.println("basarili3");"
Please help me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这(显然)与 DB 无关,只与 Struts 有关(请更正标题),并且发布的代码似乎无关紧要。
谷歌搜索“ForwardConfig 的路径不能为空”,您会发现 这个。
检查您的 Struts 配置,并确定您是否正在使用验证。
This has nothing to do (apparently) with DB, just with Struts (please correct the title),and the code posted seems irrelevant.
Googling for "The path of an ForwardConfig cannot be null", you'll find this.
Check your Struts configuration, and discover if you are using validation or not.
我发现了我的问题。我的问题是前进之前的一个简单的错误括号。但有趣的是,我在执行查询时总是遇到异常。
I found my problem. My problem was a simple wrong bracket before forward. But it was interesting that i was getting exception always while executing the query.