我正在使用以下简单查询来获取结果以进行测试。
qName = "select total_requests from (select 10000 as total_requests from dual)"; //this can be dynamic query
preStatement = connection.prepareStatement(qName);
ParameterMetaData pmd = preStatement.getParameterMetaData();
int stmtCount = pmd.getParameterCount();
int paramsCount = params == null ? 0 : params.length;
for (int i = 0; i < params.length; i++) {
if (params[i] != null) {
preStatement.setObject(i + 1, params[i]);
} else {
int sqlType = Types.VARCHAR;
if (!paramValid) {
try {
sqlType = pmd.getParameterType(i + 1);
} catch (SQLException e) {
paramValid = true;
}
}
preStatement.setNull(i + 1, sqlType);
}
}
ResultSet rs = preStatement.executeQuery();
一旦我执行第三行,应用程序就会抛出以下错误
Caused by: java.lang.AbstractMethodError: com.inet.pool.b.getParameterMetaData()Ljava/sql/ParameterMetaData;
at com.core.admin.util.AnalyzeHelper.fillQuery(AnalyzeHelper.java:61)
这是由于子查询问题吗?如何解决这个问题?