public int addBooking(Booking booking) {
		int id;
		PreparedStatement pStatement = null;
		ResultSet rs = null;
		try{
			statement = connection.createStatement();
			String query = "INSERT INTO bookings (user_id, cabin_id, date_from, date_to) "
					+ "VALUES (?, ?, ?, ?)";
			pStatement = connection.prepareStatement(query, Statement.RETURN_GENERATED_KEYS); 
			pStatement.setString(1, booking.getUser_id());
			pStatement.setInt(2, booking.getCabin_id());
			pStatement.setDate(3, new java.sql.Date(booking.getDate_From().getTime()));
			pStatement.setDate(4, new java.sql.Date(booking.getDate_To().getTime()));

			pStatement.execute();
			rs = pStatement.getGeneratedKeys();

			if(rs.next())
				id = rs.getInt(1);
			else
				id = -2;

		} catch (Exception e) {
			e.printStackTrace();
			id = -1;
		} finally {
			try{ if(rs != null) rs.close(); } catch(Exception e) {};
			try{ if(statement != null) statement.close(); } catch(Exception e) {};
		}
		return id;
	}