Some more logger info.
try
{
getLogger().info("userName @ sql: "+userName);
getLogger().info("password @ sql: "+passpword);
String sql = "SELECT count(*) as userCount FROM users where username = '"+userName+"' and password = '"+password+"'";
getLogger().info("sql: "+sql);
stmt = conn.createStatement(sql);
rs = stmt.executeQuery();
getLogger().info("rs: "+rs.toString());
if (rs.next() == true) {
getLogger().info("rs returns recordset");
if (rs.getInt("userCount") > 0)
{
getLogger().info("which contains at least 1 record so connection should be accepted");
client.acceptConnection();
}
else
{
getLogger().info("but it is empty. Wrong username or password maybe");
}
}
} catch (SQLException sqlEx) {
getLogger().error("sqlexecuteException: " + sqlEx.toString());
}
you can never have too much information.