try the following. Im not sure if it will work as I am not is a position to test it.
Add a couple of logs to the sql bit of the code to see if the values are getting Through:
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();
if (rs.next() == true) {
if (rs.getInt("userCount") > 0)
{
client.acceptConnection();
}
}
} catch (SQLException sqlEx) {