我的JDBC代码有问题。这是相关代码:
/** method for checking password into the Oracle database */
public String CheckUserDB(String userToCheck) throws SQLException {
String storedPassword;
if (ds == null) throw new SQLException("No data source");
Connection conn = ds.getConnection();
if (conn == null) throw new SQLException("No connection");
try {
conn.setAutoCommit(false);
boolean committed = false;
try {
PreparedStatement passwordQuery = conn.prepareStatement(
"SELECT passwd from USERS WHERE userz = ?");
passwordQuery.setString(1, userToCheck);
ResultSet result = passwordQuery.executeQuery();
result.next();
storedPassword = result.getString("passwd");
conn.commit();
committed = true;
} finally