我新建一个web project, 很多代码是从另一个程序中复制过来的,现在的报错为:java.lang.NoClassDefFoundError: javax/sql/rowset/Joinable, 具体就是在执行下面红色标记行处的错,因为前一句System.out.println有结果,后面的就没有结果了。
我看了javax/sql/rowset/Joinable主要是在oracle的包里面,我的另一个程序用了oracle 8/9/10 3个jar包,因此我这个也照用,没想到却出这样的错。
另外,我将JDK改为1.4的时候,import javax.sql.rowset.*;这句好象就不能识别。 JDK改成1.5就没问题。但我另外那个程序JDK就算改变这句import均可以识别。请高手帮忙,问题到底是出在哪里啊??? public OracleCachedRowSet getRowSet() throws SQLException,
NamingException {
PreparedStatement ps = null;
ResultSet resultSet = null;
Connection conn = null;
try {
conn = CommonTool.getConnection(this.dbName);
System.out.println("Connect success:"+this.dbName);
this.setParamList();
//this.handleWildcard();
ps = conn.prepareStatement(sqlString);
this.assignParamValue(ps);
ps.setQueryTimeout(60 * 10);
resultSet = ps.executeQuery();
System.out.println("Before OracleCachedRowSet");
rowSet = new OracleCachedRowSet(); System.out.println("After OracleCachedRowSet");
rowSet.populate(resultSet);
}
catch (SQLException ex) {
log.error("SQLException while query: " + ex);
throw ex;
}
finally {
if (ps != null) { ps.close(); }
if (resultSet != null) { resultSet.close(); }
if (conn != null) { conn.close();
}
} return rowSet;
}
解决方案 »
- (Struts2+JSON+Ajax) XMLHttpRequest ==500怎么解决?
- java.lang.reflect.InvocationTargetException
- tomcat + iis + fileupload Exception 异常,流被关闭了。
- junit测试的问题
- hql hibernate 问题 有关between and
- richfaces <a4j:commandButton> <h:commandLink>共用问题
- 一直不明白 的JS的问题
- 如何点"打印"按钮后,打印另外一页的内容?
- javac编译出错,各位帮帮忙检查一下!
- 倾我所有----高手请进
- strus上传、下载文件找不到指定的服务器目录?!
- 大神求救
jdk不能识别是因为jdk版本不同么 类所在的jar包是用1.6版本的编译的 所以你用1.4就不对了
我之前那个OK的程序,用1.4,1.5都可以也。