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

 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页面和代码测试也不出现空指针异常,求大神指点……
繁华开满天机
浏览 593回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java