try {
stmt = con.getStmtread();---------->做什么用的,实例化StateMent好像不是调用Connection的这个方法吧。是createStatement
rs = stmt.executeQuery("SELECT COUNT(*) FROM " + strSql);
if (rs.next()) {
intCount = rs.getInt(1);
} else {
intCount = -1;
}
} catch (Exception e) { ---->一般不要在异常中这么处理
intCount = -2;
System.err.println(e.getMessage());
e.printStackTrace();
} finally {
con.close();
return intCount;
}
stmt = con.getStmtread();---------->做什么用的,实例化StateMent好像不是调用Connection的这个方法吧。是createStatement
rs = stmt.executeQuery("SELECT COUNT(*) FROM " + strSql);
if (rs.next()) {
intCount = rs.getInt(1);
} else {
intCount = -1;
}
} catch (Exception e) { ---->一般不要在异常中这么处理
intCount = -2;
System.err.println(e.getMessage());
e.printStackTrace();
} finally {
con.close();
return intCount;
}
stmt = con.getStmtread();---------->做什么用的,实例化StateMent好像不是调用Connection的这个方法吧。是createStatement
rs = stmt.executeQuery("SELECT COUNT(*) FROM " + strSql);
if (rs.next()) {
intCount = rs.getInt(1);
} else {
intCount = -1;
}
} catch (Exception e) { ---->一般不要在异常中这么处理
intCount = -2;
System.err.println(e.getMessage());
e.printStackTrace();
} finally {
con.close();
return intCount;
}
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
楼上的谢谢了 你说的哪个调用我开始的时候就试过了可是里面调用的时候会出错的,在下面异常的时候也会抛错。不过我知道那里错了,已经解决~~好难悟道啊~