holidayReader.open(new InputStreamReader(this.getClass().getResourceAsStream("holidays_de.csv")));
while (holidayReader.hasNext())
{
Holiday holiday = holidayReader.next();
if (holiday.getYear() != null)
{
update("INSERT INTO holiday (name, country, province, day, month, year) values (?, ?, ?, ?, ?, ?)",
new Object[]
{
holiday.getName(), holiday.getCountry(), holiday.getProvince(),
holiday.getDay(), holiday.getMonth(), holiday.getYear()
});
}
else
{
update("INSERT INTO holiday (name, country, province, day, month) values (?, ?, ?, ?, ?)", new Object[]
{
holiday.getName(), holiday.getCountry(), holiday.getProvince(), holiday.getDay(),
holiday.getMonth()
});
}
}
}