I'm trying to figure out why my application is unable to unlock a user's Oracle account successfully. Here's a snippet from my code:
OracleDataSource ods = new oracle.jdbc.pool.OracleDataSource();
Properties props = new Properties();
props.put("user", "sys");
props.put("password", "sys");
props.put("internal_logon", "sysdba");
ods.setConnectionProperties(props);
ods.setURL("jdbc:oracle:thin:@localhost:1523:TEST_DB");
Connection conn = ods.getConnection();
Statement stmt = conn.createStatement();
stmt.execute("ALTER USER SCOTT ACCOUNT UNLOCK");
stmt.close();
At no point does it raise an SQLException
or report any problems, but the user's account doesn't actually get unlocked. Am I missing something obvious here or is there some cunning way of getting this to work?