用了DS,总是发生这种错误Operation not allowed after ResultSet closed 啊?这是你程序的问题,和你使用数据源没有关系。问题出在在 你的记录集关闭之后,你还使用它取数据;检查你是不是不小心关闭了连接,或者rs,然后还使用rs.getString("...");之类的 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 但是,为什么我换成用直接用URL连接数据库,就不会存在这个问题。看看 private Connection getConnection() throws NamingException, SQLException { try { Class.forName("com.mysql.jdbc.Driver"); return DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/smgp_6789", "smspf","iamroot"); } catch (Exception ex) { System.err.println(" * Error: get DB connection error. Ex. msg: " + ex); ex.printStackTrace(); return null; } }*************************************************************************************// protected Connection createConnection() throws NamingException, SQLException// {//// Context ctx = new InitialContext();// DataSource ds = (DataSource)ctx.lookup(DATASOURCE_NAME);//// System.out.println("***********************************\nbegin get ds conn\n****************");// return ds.getConnection();// }上面两个,我用第一个getConnection(),不会存在关闭rs得问题。而用了createConnection(),就发生了 有关ibatis事务问题 MyEclipse8.5符号被替换为HTML字符的问题----超诡异!!!!!! 乱码问题? 关于JSP上传下载文件,删除文件的实现 关于页面刷新问题 history.go(-1) jsp编译出错。高手请帮帮忙。小弟在这先谢谢了。 js脚本中有没有一种方法,能在ie页面关闭前触发? Lomboz问题终于搞定了,高兴,散分,顶者有分 介绍基本JSP/BEAN的好书。 哪位大神帮忙看看,谢谢 怎样让textarea自动折行? 我被乱码给整死了。。。
try {
Class.forName("com.mysql.jdbc.Driver");
return DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/smgp_6789", "smspf","iamroot");
} catch (Exception ex) {
System.err.println(" * Error: get DB connection error. Ex. msg: " + ex); ex.printStackTrace(); return null;
} }
*************************************************************************************
// protected Connection createConnection() throws NamingException, SQLException
// {
//
// Context ctx = new InitialContext();
// DataSource ds = (DataSource)ctx.lookup(DATASOURCE_NAME);
//
// System.out.println("***********************************\nbegin get ds conn\n****************");
// return ds.getConnection();
// }
上面两个,我用第一个getConnection(),不会存在关闭rs得问题。而用了createConnection(),就发生了