I am running on an AS400 with Tomcat. Below is my code to connect to the database. I can connect fine when I use the correct username and password, but if I use an invalid password it disables my user id after one try! I added the trace=true to the url and saw that it actually tried three times to connect. Is there a way to make it try only once?
private Connection setupDB2Connection(String username, String password) throws SQLException {
if (connDB2!=null) {
if(!connDB2.isClosed()) {
connDB2.close();
connDB2 = null;
}
}
DriverManager.registerDriver(new com.ibm.as400.access.AS400JDBCDriver());
DriverManager.setLoginTimeout(1);
if (username == null || password == null) {
connDB2 = DriverManager.getConnection("jdbc:as400://EJDEV;prompt=true");
}
else {
connDB2 = DriverManager.getConnection("jdbc:as400://EJDEV;prompt=false", username, password);
}
return connDB2;
}