"INSERT INTO vacation" + " (sourceId, creationDate, advertiserName, idFromAdvertiser, vacationType, title, extraInfo, shortDescription, longDescription, continentCode, countryCode, city, dayCount, nightCount, hotelName, smallImageUrl, bigImageUrl, detailUrl)" + " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; PreparedStatement ps = con.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS); ps.setString(1, vacation.getSourceId()); ps.setTimestamp(2, toTimestamp(vacation.getCreationDate())); ps.setString(3, vacation.getAdvertiserName()); ps.setString(4, vacation.getIdFromAdvertiser()); ps.setString(5, vacation.getVacationType()); ps.setString(6, vacation.getTitle()); ps.setString(7, vacation.getExtraInfo()); ps.setString(8, vacation.getShortDescription()); ps.setString(9, vacation.getLongDescription()); ps.setString(10, vacation.getContinentCode()); ps.setString(11, vacation.getCountry().getCode()); ps.setString(12, vacation.getCity()); ps.setInt(13, vacation.getDayCount()); ps.setInt(14, vacation.getNightCount()); ps.setString(15, vacation.getHotelName()); ps.setString(16, vacation.getSmallImageUrl()); ps.setString(17, vacation.getBigImageUrl()); ps.setString(18, vacation.getDetailUrl()); return ps; }