public void update() throws ESellException {

		if (id == null) // Petition wurde noch nicht mit der DB abgeglichen.
			throw new ESellException(ESellException.ErrorCode.NO_ENTRY_ERR);
		
		makeConnection();
		PreparedStatement preparedStatement = null;

		if (conn != null) {
			try {
				// Statement vorbereiten
				String sql = "UPDATE petitions SET user_id = ?, title = ?, description = ?, price = ?, category_id = ?, amount = ?, image_url = ?, state = ?, created = ? WHERE id = ?";
				preparedStatement = conn.prepareStatement(sql);
				preparedStatement.setInt(1, this.userID);
				preparedStatement.setString(2, this.title);
				preparedStatement.setString(3, this.description);
				preparedStatement.setInt(4, this.price);
				preparedStatement.setInt(5, this.categoryID);
				preparedStatement.setInt(6, this.amount);
				if (this.imageURL != null)
					preparedStatement.setString(7, this.imageURL.toString());
				else
					preparedStatement.setString(7, null);
				preparedStatement.setString(8, this.state);
				preparedStatement.setDate(9, this.created);

				preparedStatement.setInt(10, this.id);

				// System.out.println(preparedStatement);

				// Statement absetzen
				int affectedRows = preparedStatement.executeUpdate();

				if (affectedRows > 0)
					return;
				else
					throw new ESellException(ESellException.ErrorCode.UPDATE_ERR);

			} catch (SQLException e) {
				// ToDo
				// e.printStackTrace();
				throw new ESellException(ESellException.ErrorCode.DB_ERR);
			}
		}
		throw new ESellException(ESellException.ErrorCode.DB_ERR);
	
	
	}