// $Id: ComicsDB.java 3489 2005-11-27 18:48:26Z coelho $ import java.sql.*; /** 'comics' database stuff. */ public abstract class ComicsDB { // ATTRIBUTS protected Connection dbc; protected Statement sta; protected PreparedStatement adalb, adaut; // CONSTRUCTEUR public ComicsDB(Connection dbc) throws SQLException { this.dbc = dbc; // À compléter // - initialisation de sta // - initialisation du adalb : SELECT ajoute_album(?,?,?,?,?,?) // - initialisation du adaut : SELECT ajoute_auteur(?,?,?,?,?) } // MÉTHODES /** this method could be overriden for HTML, String... */ protected abstract Object getSomething(String query) throws SQLException; public Object getAuteurs() throws SQLException { return getSomething( // À compléter : extraction numéro et identifiant texte pour un auteur ); } public Object getCollections() throws SQLException { return getSomething( // À compléter : extraction numéro et identifiant texte pour une collection ); } public Object getEditeurs() throws SQLException { return getSomething( // À compléter : extraction numéro et identifiant texte pour un éditeur ); } public Object getLangues() throws SQLException { return getSomething( // À compléter : extraction numéro et identifiant texte pour une langue ); } public void addOuvrage(String titre, int annee, int editeur, int collection, int auteur, int langue) throws SQLException { // À compléter : appel de adalb avec les paramètres } public void addAuteur(String titre, int annee, int collection, int auteur, int langue) throws SQLException { // À compléter : appel de adaut avec les paramètres } }