public boolean userExists(Transaction trans, String table, String username) throws DatabaseException{
		try {
		      if(!validString(username)) {
		    	throw new SQLException("Trying to use invalid characters at username:'"+username+"'");
		      }
		      String query = "";
			  Connection connection = ((JDBCTransaction)trans).getConnection();
			  Statement stmt = connection.createStatement();
			  if(table.equalsIgnoreCase("login")) {
				  query = SQL_LOGIN_NC + "'"+username+"';";
			  } else if(table.equalsIgnoreCase("characters")) { 
				  query = SQL_CHARS_NC + "'"+username+"';";
			  }
			  ResultSet result = stmt.executeQuery(query);
	
		      if(result.next()) {
		    	  if(result.getInt("amount")!=0) {
		    		  return true;
		          }
		      }
		      	return false;
	      } catch(SQLException sqle){
	    	  throw new DatabaseException(sqle);
	      }
	}