为了账号安全,请及时绑定邮箱和手机立即绑定

java用jboss服务器开发web项目出现空指针异常

java用jboss服务器开发web项目出现空指针异常

繁华开满天机 2018-12-07 00:21:55
1 public static CachedRowSetImpl getRowSet(String sql){ 2 Connection conn = null; 3 PreparedStatement prep = null; 4 ResultSet rs = null; 5 CachedRowSetImpl rowset = null; 6 try { 7 conn = getConnection(); 8 rowset = new CachedRowSetImpl(); 9 prep = conn.prepareStatement(sql); 10 rs = prep.executeQuery(); 11 rowset.populate(rs); 12 } catch (Exception e) { 13 e.printStackTrace(); 14 }finally{ 15 close(prep,conn); 16 } 17 return rowset; 18 } 在第8行处new CachedRowSetImpl()用web页面调用该方法时报空指针异常,但是用代码测试时不出现空指针异常,服务器换成tomcat用web页面和代码测试也不出现空指针异常,求大神指点……
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 592 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信