title: In java JDBC connection error ORA-28000: the account got locked, but db account is not locked
body: <p>I could connect to Oracle XE, DB from console using the credentials (Username: HR, Password : *****). But I'm getting the error message </p>
  
  <blockquote>
    <p>ORA-28000: the account got locked</p>
  </blockquote>
  
  <p>when I try to establish connection from java program using JDBC.</p>
  
  <p>Code:</p>
  
  <pre><code>public static void main(String args[]) throws Exception{
            Class.forName("oracle.jdbc.driver.OracleDriver");
            String url = "jdbc:oracle:thin:@127.0.0.1:1521:XE";
            Connection con = DriverManager.getConnection(url,"USER NAME","PASSWORD");
            Statement statement = con.createStatement();  
            ResultSet resultset = statement.executeQuery("select 'Connected' from dual");  
  
            while (resultset.next()) {
                   System.out.println(resultset.getString(1));
            }        
            statement.close();  
            con.close();  
     }
  </code></pre>
  
  <p>How to connect to DB from this java program?</p>