org.fao.gast.lib
Class DatabaseLib

java.lang.Object
  extended by org.fao.gast.lib.DatabaseLib

public class DatabaseLib
extends java.lang.Object


Nested Class Summary
static interface DatabaseLib.CallBack
           
static interface DatabaseLib.Mapper
           
 
Constructor Summary
DatabaseLib(java.lang.String appPath)
           
 
Method Summary
 void createSchema(jeeves.resources.dbms.Dbms dbms, DatabaseLib.CallBack cb)
           
 void fillTables(jeeves.resources.dbms.Dbms dbms, DatabaseLib.CallBack cb)
          Transaction must be aborted on error
 int getNextSerial(jeeves.resources.dbms.Dbms dbms, java.lang.String table)
          NOT Transactional
 java.lang.String getSetting(jeeves.resources.dbms.Dbms dbms, java.lang.String path)
          NOT Transactional
 void insert(jeeves.resources.dbms.Dbms dbms, java.lang.String table, org.jdom.Element rec, DatabaseLib.Mapper mapper)
          NOT Transactional
 void insert(jeeves.resources.dbms.Dbms dbms, java.lang.String table, org.jdom.Element rec, java.lang.String[] fields, DatabaseLib.Mapper mapper)
          NOT Transactional
 void insert(jeeves.resources.dbms.Dbms dbms, java.lang.String table, java.util.List records, java.lang.String[] fields, DatabaseLib.Mapper mapper)
          NOT Transactional
 void insert(jeeves.resources.dbms.Dbms dbms, java.lang.String table, java.util.Map<java.lang.String,java.lang.Object> fields, DatabaseLib.Mapper mapper)
          NOT Transactional
 void insert(jeeves.resources.dbms.Dbms dbms, java.lang.String table, java.util.Set<java.lang.String> langs, java.lang.String id, java.lang.String label)
           
 void setup(Resource resource, DatabaseLib.CallBack cb)
          Transactional
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseLib

public DatabaseLib(java.lang.String appPath)
Method Detail

setup

public void setup(Resource resource,
                  DatabaseLib.CallBack cb)
           throws java.lang.Exception
Transactional

Throws:
java.lang.Exception

getSetting

public java.lang.String getSetting(jeeves.resources.dbms.Dbms dbms,
                                   java.lang.String path)
                            throws java.sql.SQLException
NOT Transactional

Throws:
java.sql.SQLException

insert

public void insert(jeeves.resources.dbms.Dbms dbms,
                   java.lang.String table,
                   java.util.List records,
                   java.lang.String[] fields,
                   DatabaseLib.Mapper mapper)
            throws java.sql.SQLException
NOT Transactional

Throws:
java.sql.SQLException

insert

public void insert(jeeves.resources.dbms.Dbms dbms,
                   java.lang.String table,
                   org.jdom.Element rec,
                   DatabaseLib.Mapper mapper)
            throws java.sql.SQLException
NOT Transactional

Throws:
java.sql.SQLException

insert

public void insert(jeeves.resources.dbms.Dbms dbms,
                   java.lang.String table,
                   org.jdom.Element rec,
                   java.lang.String[] fields,
                   DatabaseLib.Mapper mapper)
            throws java.sql.SQLException
NOT Transactional

Throws:
java.sql.SQLException

insert

public void insert(jeeves.resources.dbms.Dbms dbms,
                   java.lang.String table,
                   java.util.Map<java.lang.String,java.lang.Object> fields,
                   DatabaseLib.Mapper mapper)
            throws java.sql.SQLException
NOT Transactional

Throws:
java.sql.SQLException

insert

public void insert(jeeves.resources.dbms.Dbms dbms,
                   java.lang.String table,
                   java.util.Set<java.lang.String> langs,
                   java.lang.String id,
                   java.lang.String label)
            throws java.sql.SQLException
Throws:
java.sql.SQLException

getNextSerial

public int getNextSerial(jeeves.resources.dbms.Dbms dbms,
                         java.lang.String table)
                  throws java.sql.SQLException
NOT Transactional

Throws:
java.sql.SQLException

createSchema

public void createSchema(jeeves.resources.dbms.Dbms dbms,
                         DatabaseLib.CallBack cb)
                  throws java.io.FileNotFoundException,
                         java.io.IOException,
                         java.sql.SQLException
Throws:
java.io.FileNotFoundException
java.io.IOException
java.sql.SQLException

fillTables

public void fillTables(jeeves.resources.dbms.Dbms dbms,
                       DatabaseLib.CallBack cb)
                throws java.lang.Exception
Transaction must be aborted on error

Throws:
java.lang.Exception