public static boolean login (Connection conn, String login, String password)
		{

			ResultSet resultSet = null;
			Statement statement = null;
			String dbLogin;
			String dbPassword;
			boolean authentication = false;
			
			try {
				statement = conn.createStatement();
				resultSet = statement
					.executeQuery("select * from 8306_traffii1.User");
			while (resultSet.next()) {
				dbLogin = resultSet.getString("Login");

				dbPassword = resultSet.getString("Password");

				if (dbLogin.equals(login))
					if (dbPassword.equals(password)) {
						authentication = true;
						
						String query = "UPDATE 8306_traffii1.User " +
				                   "SET LoggedIn = 1 WHERE Login in (?)";
						PreparedStatement preparedStmt;
						try
						{
							preparedStmt = conn.prepareStatement(query);
							preparedStmt.setString(1, login);

							preparedStmt.execute();
							return true;
						}
						catch (Exception ex)
						{
							ex.printStackTrace();
							return false;
						}
					} else
						authentication = false;
				
			}

			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
				return false;
			}
			return authentication;

		}