Title: Jdbc
Description:Jdbc -class serves an interface between the software and database using PostgreSQL.
Copyright: Copyright (c) 2006 CONCEPT-lisenssi Tekijänoikeus (c) 2006, Pekka Kuuva, Tatu Repo, Pasi Saari, Anna Seppänen. Kaikki oikeudet pidätetään. Tämän ohjelmiston levittäminen ja käyttö lähdekoodina ja binäärinä, muutettuna tai muuttamattomana, on sallittu edellyttäen, että seuraavat ehdot täytetään: 1. OHJELMISTON LEVITTÄMINEN Lähdekoodikopioissa, dokumentaatiossa ja muussa ohjelmiston mukana tulevassa aineistossa on oltava tämä lisenssi kokonaisuudessaan. 1.2. VIENTIRAJOITUKSET Ohjelmistoa tai sen osia ei saa viedä Amerikan Yhdysvaltoihin ilman tekijöiden erillistä suostumusta. 2. OHJELMISTON KÄYTTÖ (EULA) 2.1 KÄYTTÖEHDOT Ohjelmiston käyttäjän tulee joskus suorittaa vähintään yksi seuraavista toimista: a) Tarjota omalla kustannuksellaan olut tasokkaassa ravintolassa, pubissa tai muussa vastaavassa anniskelua harjoittavassa liikkeessä kullekin tekijöistä, sekä ilmoittaa tästä tarjouksesta. b) Tarjota tekijöille omalla kustannuksellaan pääsy tapahtumaan, jonka yhteydessä sovellusta on käytetty, ja ilmoittaa tästä tarjouksesta tekijöille. Ilmoittamisella tarkoitetaan vähintään viikkoa ennen tarjouk- sen täytäntöönpanoa tekijöille lähetettyä sähköpostia, jossa ilmoitetaan ohjelmiston käyttäjän nimi ja yhteystiedot sekä tarjous ja sen ajankohta. Jos käyttöehdot eivät ole täyttyneet, ohjelmistoa ei saa käyttää. 2.1. TAKUU Tekijänoikeuden haltijat ja ohjelmiston kehittäjät tarjoavat tämän ohjelmiston "sellaisena kuin se on". Sovellukselle ei myönnetä minkäänlaista takuuta kaupallisesti hyväksyttävästä laadusta eikä sen taata soveltuvan mihinkään tarkoitukseen. 2.2. VASTUUNRAJOITUS Tekijänoikeuden haltija ja ohjelmiston kehittäjät eivät ole missään tilanteessa vastuussa suorista, epäsuorista, yleisistä, erityisistä, satunnaisista tai seurauksellisista vahingoista (sisältäen, muttei tyhjentävästi, korvaavan tuotteen tai palvelun hankinnan, käyttömahdollisuuden, tiedon tai voittojen menetykset, tai liiketoiminnan keskeytymisen), jotka aiheutuvat miten tahansa ja millä tahansa vahingonkorvausoikeudellisella perusteella mukaanlukien sopimusvastuu, ankara vastuu ja sopimuksen ulkoinen vastuu (huolimattomuus tai muu), vaikka kyseisten vahinkojen mahdollisuudesta olisi kerrottu.
Constructor Detail |
public Jdbc(java.lang.String database, java.lang.String username, java.lang.String password)
database
- String Address to the databaseusername
- String Username.password
- String Password.public Jdbc()
Method Detail |
public java.sql.DatabaseMetaData connection()
ClassNotFoundException
- If there ain't no such class.SQLException
- if operation failed.public boolean isClosed()
SQLException
- if operation failed.public concept.structure.Conference readConference()
SQLException
- if operation failed.public boolean readPreference()
SQLException
- if operation failedprivate void readHalls()
SQLException
- if operation failed.private void readHallRestrictions()
SQLException
- failedprivate void readUsers(concept.structure.Presenters presenters)
presenters
- Presenters contains all presenters of the conference.SQLException
- if operation failed.private void readSessionType()
SQLException
- if operation failed.private void readTopic()
SQLException
- if operation failed.private void readArticle(concept.structure.Presentations presentations)
presentations
- Presentations contains all presentations of the conference.SQLException
- is operation failed.private void readPresent(concept.structure.Presentations presentations, concept.structure.Presenters presenters)
presentations
- Presentations Adds the link to.presenters
- Presenters Link that is added to presentation.SQLException
- if operation failed.private void readKeywords()
SQLException
- if operation failed.private void readScheduleType()
SQLException
- if operation failed.private void readSchedule()
SQLException
- if operation failed.private void readSessions(concept.structure.Sessions sessions)
sessions
- Sessions Contains all sessions. Sessions are added to this class.SQLException
- if operation failed.private void readSessionlinksAtArticle(concept.structure.Sessions sessions, concept.structure.Presentations presentations)
sessions
- Sessions Adds the links topresentations
- Presentations Links.SQLException
- if operation failed.private void readChairmen(concept.structure.Presenters presenters)
presenters
- Presenters All presenters of the conference. Presenters that are set to be chairmen get chairman topics and maximum value of chairman duties.SQLException
- if operation failed.private void readChairman(concept.structure.Sessions sessions, concept.structure.Presenters presenters)
sessions
- Sessions Session linkpresenters
- Presenters Chairman link.SQLException
- if operation failed.private void readRestiction(concept.structure.Presenters presenters, concept.structure.Sessions sessions)
presenters
- Presenters Contains all the presenters of the conference.sessions
- Sessions Contains all the sessions of the conference.SQLException
- if operation failed.private void readSpecialty(concept.structure.Presentations presentations, concept.structure.Sessions sessions)
presentations
- Presentations Contains all the presentations of the conference.sessions
- Sessions Contains all the sessions of the conference.SQLException
- if operation failed.public void addPreference(concept.structure.Preference preference)
preference
- Preference Preferences of the conference.SQLException
- if operation failed.public void sessionAdd(concept.structure.Session session)
session
- Session Session that will be added.SQLException
- if operation failed.public void sessionDelete(concept.structure.Session session)
session
- Session Session that will be deleted.SQLException
- if operation failed.public void sessionUpdate(concept.structure.Session session)
session
- Session Session that will be updated.SQLException
- if operation failed.public void sessionUpdateIsReady(concept.structure.Session session)
session
- Session Session that will be updated.SQLException
- if operation failed.public void presentationUpdateSession(concept.structure.Presentation presentation)
presentation
- Presentation Article that will be linked.SQLException
- if operation failed.public void chairmanToSession(concept.structure.Presenter chairman, concept.structure.Session session)
chairman
- Presenter Chairmansession
- Session Session that will be cairmanned.SQLException
- if operation failed.public void chairmanFromSession(concept.structure.Presenter chairman, concept.structure.Session session)
chairman
- Presenter Chairman to remove.session
- Session Removed from.SQLException
- if operation failed.public void hallAddRestriction(concept.structure.Hall hall, concept.structure.ScheduleRestriction r)
hall
- Hallr
- ScheduleRestrictionSQLException
- if operation failed.public void hallDeleteRestriction(concept.structure.Hall hall)
hall
- HallSQLException
- if operation failed.public void addHallToDay(concept.structure.Hall hall, long day)
hall
- Hall Hall to be added.day
- long Add to.SQLException
- if operation failed.public void deleteHallFromDay(concept.structure.Hall hall, long day)
hall
- Hall Hall to delete.day
- long Delete from.SQLException
- if operation failed.public void blockAdd(concept.structure.Block block)
block
- BlockSQLException
- if operation failed.public void blockUpdate(concept.structure.Block block)
block
- Block Block to updateSQLException
- if operation failed.public void blockDelete(concept.structure.Block block)
block
- BlockSQLException
- if operation failed.public void restrictionDelete(concept.structure.ScheduleRestriction sch)
sch
- ScheduleRestrictionSQLException
- if operation failed.public void restrictionAdd(concept.structure.ScheduleRestriction sch, boolean isPresenter, int id)
sch
- ScheduleRestriction restriction that will be added.isPresenter
- boolean if restriction is related to presenter. False, if restriction is related to a presentationid
- int Id of presenter or presentation.SQLException
- if operation failed.public java.util.Vector searchSessions(java.lang.String title, java.lang.String abbrev, concept.structure.Topic topic, concept.structure.Type type, boolean ready, boolean notready, boolean limit, boolean nolimit, boolean scheduled, boolean notscheduled)
title
- String Search by this title.abbrev
- String Search by this abbreviation.topic
- Topic Search by this topic.type
- Type Search by this sessiontype.ready
- boolean Is readynotready
- boolean Isn't ready. If both ready and not ready are of the same value, these values are omitted.limit
- boolean Has limits.nolimit
- boolean Has no limits. If both limits and nolimits are of the same value, these values are omitted.scheduled
- boolean Is scheduled.notscheduled
- boolean Isn't scheduled. If both scheduled and notscheduled are of the same value, these values are omitted.SQLException
- if operation failed.private java.util.Vector addSessionSearchResult(boolean limit, boolean nolimit, boolean scheduled, boolean notscheduled, java.util.Vector result, concept.structure.Session searchresult)
limit
- booleannolimit
- booleanscheduled
- booleannotscheduled
- booleanresult
- Vectorsearchresult
- Sessionprivate java.util.Vector addSessionSearchResult(boolean scheduled, boolean notscheduled, java.util.Vector result, concept.structure.Session searchresult)
scheduled
- booleannotscheduled
- booleanresult
- Vectorsearchresult
- Sessionpublic java.util.Vector searchSessions(java.lang.String title, java.lang.String abbrev, concept.structure.Topic topic, concept.structure.Type type, concept.structure.Presenter chairman, boolean ready, boolean notready, boolean limit, boolean nolimit, boolean scheduled, boolean notscheduled)
title
- String Search by this title.abbrev
- String Search by this abbreviation.topic
- Topic SEarch by this topic.type
- Type Search by this sessiontype.chairman
- Presenter Search by this chairman.ready
- boolean Is readynotready
- boolean Isn't ready. If both ready and not ready are of the same value, these values are omitted.limit
- boolean Has limits.nolimit
- boolean Has no limits. If both limits and nolimits are of the same value, these values are omitted.scheduled
- boolean Is scheduled.notscheduled
- boolean Isn't scheduled. If both scheduled and notscheduled are of the same value, these values are omitted.SQLException
- if operation failed.public java.util.Vector searchArticles(java.lang.String title, concept.structure.Topic topic, concept.structure.Type type, java.lang.String presenter, java.lang.String key1, java.lang.String key2, java.lang.String key3, boolean registered, boolean notregistered, boolean placed, boolean notplaced, boolean limits, boolean nolimits)
title
- String Search by this titletopic
- Topic Search b this topictype
- Type Search by this sessiontype.presenter
- String Searsh by this presenter name.key1
- String keyword.key2
- String keyword.key3
- String keyword.registered
- boolean Is registered.notregistered
- boolean Isn't registered. If both registered and notregistered are of the same value, these values are omitted.placed
- boolean Is placed into session.notplaced
- boolean Isn't placed into session. If both placed and nootplaced are of the same value, these values are omitted.limits
- boolean Has limits.nolimits
- boolean Has no limits. If both limits and nolimits are of the same value, these values are omitted.SQLException
- if operation failed.public java.util.Vector searchArticles(java.lang.String title, concept.structure.Topic topic, concept.structure.Type type, java.lang.String presenter, java.lang.String key1, java.lang.String key2, java.lang.String key3, int grade, boolean registered, boolean notregistered, boolean placed, boolean notplaced, boolean limits, boolean nolimits)
title
- String Search by this titletopic
- Topic Search b this topictype
- Type Search by this sessiontype.presenter
- String Searsh by this presenter name.key1
- String keyword.key2
- String keyword.key3
- String keyword.grade
- int grade of an article.registered
- boolean Is registered.notregistered
- boolean Isn't registered. If both registered and notregistered are of the same value, these values are omitted.placed
- boolean Is placed into session.notplaced
- boolean Isn't placed into session. If both placed and nootplaced are of the same value, these values are omitted.limits
- boolean Has limits.nolimits
- boolean Has no limits. If both limits and nolimits are of the same value, these values are omitted.SQLException
- if operation failed.private java.util.Vector addArticleSearchResult(boolean placed, boolean notplaced, boolean limits, boolean nolimits, java.util.Vector result, concept.structure.Presentation searchresult)
placed
- booleannotplaced
- booleanlimits
- booleannolimits
- booleanresult
- Vectorsearchresult
- Presentationprivate java.util.Vector addArticleSearchResult(boolean limits, boolean nolimits, java.util.Vector result, concept.structure.Presentation searchresult)
limits
- booleannolimits
- booleanresult
- Vectorsearchresult
- Presentationpublic int getSameTitle(concept.structure.Session session)
session
- SessionSQLException
- if operation failedprivate static java.lang.String safety(java.lang.String s)
s
- String String that is testedpublic void closeConnection()
SQLException
- public void lockDatabase()
SQLException
- if operation failed.public void unlockDatabase()
SQLException
- if operation failed.public static void main(java.lang.String[] args)
args
- String[]SQLException
- if operation failedClassNotFoundException
- if class was not found.