title: How do I unlock an Oracle user's account from Java?
body: <p>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:</p>
  
  <pre><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();
  </code></pre>
  
  <p>At no point does it raise an <code>SQLException</code> 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?</p>