org.oreodata.jdbcimpl
Class JDBCConnection

java.lang.Object
  |
  +--org.oreodata.jdbcimpl.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 Oreo semantics with JDBC semantics.

Author:
Jonathan Revusky

Field Summary
protected  java.sql.Connection conn
           
 
Constructor Summary
JDBCConnection(java.sql.Connection conn, ConnectionPool pool)
           
JDBCConnection(java.lang.String jdbcURL, java.lang.String userID, java.lang.String password, boolean autoCommit)
           
 
Method Summary
 boolean autocommits()
           
 void close()
           
 void commit()
           
 java.util.List getPrimaryKeys(java.lang.String type)
           
 boolean isClosed()
           
 void performDeletion(Record rec)
           
 void performDeletion(java.lang.String type, java.lang.Object key)
           
 void performInsertion(Record rec)
           
 void performUpdate(Record rec)
           
 void release()
           
 Record retrieveValues(java.lang.String type, java.lang.Object primaryKey)
           
 void rollback()
           
 int selectCount(java.lang.String recordType, RecordFilter filter, boolean doubleQuoteLiteral)
           
 java.util.List selectRecords(java.lang.String recordType, RecordFilter filter, RecordComparator comparator, boolean doubleQuoteLiteral)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

conn

protected java.sql.Connection conn
Constructor Detail

JDBCConnection

public JDBCConnection(java.lang.String jdbcURL,
                      java.lang.String userID,
                      java.lang.String password,
                      boolean autoCommit)

JDBCConnection

public JDBCConnection(java.sql.Connection conn,
                      ConnectionPool pool)
Method Detail

isClosed

public boolean isClosed()

getPrimaryKeys

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

close

public void close()

performDeletion

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

performDeletion

public void performDeletion(java.lang.String type,
                            java.lang.Object key)
                     throws java.sql.SQLException,
                            DataException
java.sql.SQLException
DataException

performInsertion

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

performUpdate

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

retrieveValues

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

selectRecords

public java.util.List selectRecords(java.lang.String recordType,
                                    RecordFilter filter,
                                    RecordComparator comparator,
                                    boolean doubleQuoteLiteral)
                             throws java.sql.SQLException,
                                    java.io.IOException
java.sql.SQLException
java.io.IOException

selectCount

public int selectCount(java.lang.String recordType,
                       RecordFilter filter,
                       boolean doubleQuoteLiteral)
                throws java.sql.SQLException,
                       java.io.IOException
java.sql.SQLException
java.io.IOException

rollback

public void rollback()
              throws DataException
DataException

commit

public void commit()
            throws DataException
DataException

release

public void release()

autocommits

public boolean autocommits()