public static int[] GetUser(String username, String password){
    try
    {
        
        String query = String.format("SELECT * FROM APPUSERS WHERE USERNAME = '%s' AND PASSWORD  ='%s'", username, password);
        
        int[] udetails = new int[2];
        ResultSet rs = getQueryResults(query);
        while (rs.next())
                {
                    udetails[0] = rs.getInt("USERTYPE");
                    udetails[1] = rs.getInt("USERID");
                }
        //con.close(); //might need to close the connection at another point, doing it here throws and excepction with the resultset.
        return udetails;
    }
    catch (SQLException se)
            {
            return new int[]{-1,-1}; //Login FAILED!
            }   
}