butler.sql.driver
Class JDBCDriver

java.lang.Object
  extended by butler.sql.driver.JDBCDriver
All Implemented Interfaces:
ButlerDriver

public class JDBCDriver
extends java.lang.Object
implements ButlerDriver

Driver that performs database operations using jdbc operation.

Author:
Fredrik Bertilsson

Constructor Summary
JDBCDriver()
           
 
Method Summary
 Record createRecord(Table tab)
           
 void createView(View view)
           
 void deleteRecord(Record rec, boolean cascade)
           
 void dropTable(Table tab)
           
 Record findByPK(Table tab, butler.util.Tuple key)
           
 void loadCatalogs(Database db)
           
 void loadFKs(Table tab)
           
 void loadSchemas(Catalog cat)
           
 void loadTable(Table tab)
           
 java.util.Map loadTables(Schema schema, java.lang.String pattern)
           
protected  JPreparedStatement prepareStatement(java.sql.Connection conn, java.lang.String sql)
           
 RecordList runQueryInstance(QueryInstance qi)
           
 void saveRecord(Record rec)
           
 void saveRecordList(RecordList recList)
           
 void setBatchUpdate(boolean flag)
           
 void upgradeTable(Table tab)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCDriver

public JDBCDriver()
Method Detail

findByPK

public Record findByPK(Table tab,
                       butler.util.Tuple key)
                throws java.lang.Exception
Specified by:
findByPK in interface ButlerDriver
Throws:
java.lang.Exception

runQueryInstance

public RecordList runQueryInstance(QueryInstance qi)
                            throws java.lang.Exception
Specified by:
runQueryInstance in interface ButlerDriver
Throws:
java.lang.Exception

saveRecord

public void saveRecord(Record rec)
                throws java.lang.Exception
Specified by:
saveRecord in interface ButlerDriver
Throws:
java.lang.Exception

deleteRecord

public void deleteRecord(Record rec,
                         boolean cascade)
                  throws java.lang.Exception
Specified by:
deleteRecord in interface ButlerDriver
Throws:
java.lang.Exception

prepareStatement

protected JPreparedStatement prepareStatement(java.sql.Connection conn,
                                              java.lang.String sql)
                                       throws java.lang.Exception
Throws:
java.lang.Exception

upgradeTable

public void upgradeTable(Table tab)
                  throws java.lang.Exception
Specified by:
upgradeTable in interface ButlerDriver
Throws:
java.lang.Exception

createView

public void createView(View view)
                throws java.lang.Exception
Throws:
java.lang.Exception

dropTable

public void dropTable(Table tab)
               throws java.lang.Exception
Specified by:
dropTable in interface ButlerDriver
Throws:
java.lang.Exception

loadTables

public java.util.Map loadTables(Schema schema,
                                java.lang.String pattern)
                         throws java.lang.Exception
Specified by:
loadTables in interface ButlerDriver
Throws:
java.lang.Exception

loadTable

public void loadTable(Table tab)
               throws java.lang.Exception
Specified by:
loadTable in interface ButlerDriver
Throws:
java.lang.Exception

loadFKs

public void loadFKs(Table tab)
             throws java.lang.Exception
Specified by:
loadFKs in interface ButlerDriver
Throws:
java.lang.Exception

loadCatalogs

public void loadCatalogs(Database db)
                  throws java.lang.Exception
Specified by:
loadCatalogs in interface ButlerDriver
Throws:
java.lang.Exception

loadSchemas

public void loadSchemas(Catalog cat)
                 throws java.lang.Exception
Specified by:
loadSchemas in interface ButlerDriver
Throws:
java.lang.Exception

createRecord

public Record createRecord(Table tab)
                    throws java.lang.Exception
Specified by:
createRecord in interface ButlerDriver
Throws:
java.lang.Exception

saveRecordList

public void saveRecordList(RecordList recList)
                    throws java.lang.Exception
Specified by:
saveRecordList in interface ButlerDriver
Throws:
java.lang.Exception

setBatchUpdate

public void setBatchUpdate(boolean flag)