public boolean login(String user, String password) throws Exception 
	{
		boolean check = false;
		try {
			Class.forName("com.mysql.jdbc.Driver");
			// setup the connection with the DB.
			Connection connect = DriverManager
					.getConnection("jdbc:mysql://localhost/feedback?"
							+ "user=sqluser&password=assword");
			PreparedStatement preparedStatement = connect.prepareStatement("select USER, password from FEEDBACK.main where USER= ? ; ");
			preparedStatement.setString(1,user);
			ResultSet resultSet = preparedStatement.executeQuery(); 
			// Check password
			while (resultSet.next()) {

				String user2 = resultSet.getString("USER");
				if(user2.equals("")) { System.out.println("User not found"); }

				String dbpw = resultSet.getString("password");
				if(!dbpw.equals(password)) { System.out.println("Password incorrect"); check = false;}
				else { check = true; }
			}  

		} catch (Exception e) {
			throw e;
		}
		return check;
	}