public int GetDeviceID(String deviceName, int userID) throws Exception {
		String s = "-8";
		int id = -2;
		try {
			// This will load the MySQL driver, each DB has its own driver
			Class.forName("com.mysql.jdbc.Driver");
			// Setup the connection with the DB
			_connect = DriverManager.getConnection(_url, _user, _password);
			// PreparedStatements can use variables and are more efficient
			String sql = "SELECT * FROM devices WHERE name = ? AND users_id = ?";
			_preparedStatement = _connect.prepareStatement(sql);
			_preparedStatement.setString(1, deviceName);
			_preparedStatement.setInt(2, userID);
			_resultSet = _preparedStatement.executeQuery();

			if (_resultSet.next()) {
				s = _resultSet.getString("id");
				id = Integer.parseInt(s);
			}

		} catch (Exception e) {
			throw e;
		} finally {
			close();
		}
		return id;
	} // End getUserID