title: Connecting Java and Teradata: The UserId, Password or Account is invalid
body: <p>I have been trying to connect to Teradata  </p>
  
  <pre><code>Class.forName("com.teradata.jdbc.TeraDriver");
          String connectionString = "jdbc:teradata://xxx.xxxxxx.com/database=xxxxxx,  tmode=ANSI,  charset=UTF8";
          String user = "Rocket512";
          String password = "aui8mn5";
          Connection conn = DriverManager.getConnection(connectionString, user, password);
  </code></pre>
  
  <p>Got the following </p>
  
  <pre><code>  Exception in thread "main" com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata Database] 
  [TeraJDBC 14.10.00.17] [Error 8017] [SQLState 28000] The UserId, Password or Account is invalid.
          at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDatabaseSQLException(ErrorFactory.java:300)
          at com.teradata.jdbc.jdbc.GenericLogonController.run(GenericLogonController.java:666)
          at com.teradata.jdbc.jdbc_4.TDSession.&lt;init&gt;(TDSession.java:216)
  </code></pre>
  
  <p><strong>I know that the host is specified correctly since i did not get <code>UnknownHost Exception.</code>
  Also I have double checked my userid and password are correct.</strong></p>
  
  <hr>
  
  <p>I ran query suggested by @beni23 (thank you)</p>
  
  <pre><code>select * 
  from dbc.logonoff 
  where logdate &gt;= date '2013-10-31'
  </code></pre>
  
  <p>Here is the result that I got</p>
  
  <p><img src="https://i.stack.imgur.com/2kChV.png" alt="enter image description here"></p>
  
  <p>What is <code>Bad Password</code>? I used SQL Assistant with this very password and it works great. Why cannot i connect with Java?</p>