com.ltu.smd116.dbp
Class DBWeather
com.ltu.smd116.misc.DataCore
|
+--com.ltu.smd116.dbp.DBWeather
- public class DBWeather
- extends DataCore
This is the database provider for weather.
- Author:
- Daniel Nilsson
Constructor Summary |
DBWeather() Create a new database provider for weather. |
Methods inherited from class com.ltu.smd116.misc.DataCore |
connect, createPreparedStatament, createPrepCall, createStatament, EventLog, EventLog, EventLog, execute, execute, executeQuery, executeStatement, executeString, getConnection, runStatement |
public DBWeather()
- Create a new database provider for weather.
addWeather
public void addWeather(WeatherContainer wp)
- Add a new Weather.
- Parameters:
- wp - The WeatherContainer to store.
buildWeather
private WeatherContainer buildWeather(java.sql.ResultSet rs)
getWeather
public WeatherContainer getWeather(java.sql.Date date)
- Get a weather.
- Parameters:
- date - The date for the weather you want.
- Returns: A WeatherContainer containing the requested weather.
getWeathers
public SortedVector getWeathers()
- Get all weather.
- Returns: A SortedVector of WeatherContainers.
removeWeather
public void removeWeather(WeatherContainer wp)
- Remove a Weather.
- Parameters:
- wp - The WeatherContainer to remove.
setWeather
public void setWeather(java.sql.Date date, int lowTemp, int highTemp, int lowWind, int highWind, String windDirection, String type, String description)
updateWeather
public void updateWeather(WeatherContainer wp)
- Modify a Weather.
- Parameters:
- wp - The modified WeatherContainer.