com.niggle.data.jdbc
Class JDBCConnection

java.lang.Object
  |
  +--com.niggle.data.jdbc.JDBCConnection

public class JDBCConnection
extends java.lang.Object

A wrapper object that wraps the connection to an RDBMS. It also contains some JDBC/SQL-related convenience routines that bridge Niggle semantics with JDBC semantics.


Constructor Summary
JDBCConnection(java.lang.String jdbcURL)
           
 
Method Summary
 void close()
           
 java.util.List getPrimaryKeys(java.lang.String type)
           
 boolean isClosed()
           
 void performDeletion(Record rec)
           
 void performInsertion(Record rec)
           
 void performUpdate(Record rec)
           
 Record retrieveValues(java.lang.String type, java.lang.Object primaryKey)
           
 java.util.List selectRecords(java.lang.String recordType, RecordFilter filter)
          Wraps the Statement.executeQuery
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCConnection

public JDBCConnection(java.lang.String jdbcURL)
Method Detail

isClosed

public boolean isClosed()

close

public void close()

performDeletion

public void performDeletion(Record rec)
                     throws java.sql.SQLException

performInsertion

public void performInsertion(Record rec)
                      throws java.sql.SQLException

performUpdate

public void performUpdate(Record rec)
                   throws java.sql.SQLException

retrieveValues

public Record retrieveValues(java.lang.String type,
                             java.lang.Object primaryKey)
                      throws java.sql.SQLException

selectRecords

public java.util.List selectRecords(java.lang.String recordType,
                                    RecordFilter filter)
                             throws java.sql.SQLException,
                                    java.io.IOException
Wraps the Statement.executeQuery
Parameters:
recordType - The type of records in the list
postFilter - Get rid of records that do not meet a certain criterion.
Returns:
a List of niggle records of the given recordType

getPrimaryKeys

public java.util.List getPrimaryKeys(java.lang.String type)
                              throws java.io.IOException,
                                     java.sql.SQLException