Changeset 12033


Ignore:
Timestamp:
2006-07-06T13:09:34+12:00 (18 years ago)
Author:
kjdon
Message:

removed sqlconnection stuff as its not used, and we will get rid of mysql for gs3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/service/BerryBasket.java

    r12016 r12033  
    6363    protected static final String delimiter ="|";
    6464    protected static final int delay = 1800000;
    65 
    66     protected SQLConnection connection = null;
    6765
    6866    protected Hashtable userMap = null;
     
    145143
    146144
    147     // check the database;
    148     this.connection = GS3SQLConnectionFactory.getSQLConnection(DATABASE_NAME);
    149     if (this.connection == null) {
    150         System.err.println("db was null");
    151         // connect to the default database, and create the new database
    152         this.connection = GS3SQLConnectionFactory.getSQLConnection();
    153         if (this.connection == null) {
    154         // we can't do anything
    155         return false;
    156         }
    157         System.err.println("connected to test");
    158         // create the new one
    159         if (!this.connection.createDatabase(DATABASE_NAME)) {
    160         //this.connection.close();
    161         this.connection = null;
    162         return false;
    163         }
    164         System.err.println("created new one");
    165         // connect to it
    166         if (!this.connection.connectToDatabase(DATABASE_NAME)) {
    167         //this.connection.close();
    168         this.connection = null;
    169         return false;
    170         }
    171         System.err.println("reconnected");
    172         // set up the tables
    173         if (!initialiseDatabase()) {
    174         //this.connection.close();
    175         this.connection = null;
    176         return false;
    177         }
    178         System.err.println("initialised");
    179     } else {
    180         // check the database
    181         if (!checkDatabase()) {
    182         //this.connection.close();
    183         this.connection = null;
    184         return false;
    185         }
    186     }       
    187145    return true;
    188146   
     
    239197
    240198    return null;
    241     }
    242 
    243     protected boolean initialiseDatabase() {
    244 
    245     return true;
    246     }
    247     protected boolean checkDatabase() {
    248     String command = "select * from items;";
    249     try {
    250         Statement s = this.connection.createStatement();
    251         s.execute(command);
    252         s.close();
    253     } catch (Exception e) {
    254         return false;
    255     }
    256     return true;
    257199    }
    258200
Note: See TracChangeset for help on using the changeset viewer.