你用Statement代替PreparedStatement。PreparedStatement是预编译的,要有替换参数,你的程序中没用到参数,用Statement就可以了。
另外建议定义时初始化:
PreparedStatement pins = null;
Connection c = null;
ResultSet r = null;//这个没用上就不用要了。
还有,最好操作完毕后关闭连接。
pins.close();
c.close();
另外建议定义时初始化:
PreparedStatement pins = null;
Connection c = null;
ResultSet r = null;//这个没用上就不用要了。
还有,最好操作完毕后关闭连接。
pins.close();
c.close();
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货