uk.ac.ic.doc.automed.wrappers
Class SQLWrapper

java.lang.Object
  |
  +--uk.ac.ic.doc.automed.wrappers.AutoMedWrapper
        |
        +--uk.ac.ic.doc.automed.wrappers.SQLWrapper
Direct Known Subclasses:
OracleWrapper, PostgresWrapper, TransactSQLWrapper

public abstract class SQLWrapper
extends AutoMedWrapper

An AutoMed high wrapper for connecting to SQL databases that have a JBDC driver. Note that specific lower level wrapper must be instantiated in order to use a particular database.

Author:
Peter McBrien (pjm@doc.ic.ac.uk)

Field Summary
static java.lang.String OPTION_SCHEMA_NAME
          An option key setting, the value of which should be the SQL schema which is the only one to be mapped in this wrapping
 
Fields inherited from class uk.ac.ic.doc.automed.wrappers.AutoMedWrapper
am, awf, debug, driver, password, protocol, s, url, username
 
Constructor Summary
SQLWrapper()
           
 
Method Summary
protected  void connect()
          Connect to a JDBC database in the standard way.
 ASG executeIQL(ASG q)
          Execute an IQL query on the datasource.
 AutoMedResult executeLocalQuery(AutoMedQuery q)
          Execute a query in the datasource's native query language, and obtain a result in an AutoMedResult class
 SQLResult executeSQLQuery(SQLQuery q)
          Execute a query on the data source, returning the result in the standard format for instances of SQL queries.
 java.lang.String[] getOptionKeys()
          Return the list of option setting key provided by the wrapper.
 java.lang.String getProtocolName()
          The name of the Protocol in the repository used to represent JDBC connections.
 
Methods inherited from class uk.ac.ic.doc.automed.wrappers.AutoMedWrapper
atDebugLevel, cacheWrapper, deleteIQL, getAccessMethod, getAutoMedWrapper, getAutoMedWrapper, getAutoMedWrapperFactory, getDefaultWrapperFactory, getOption, getProtocol, getSchema, getSchema, insertIQL, newAutoMedSchema, newAutoMedWrapper, newAutoMedWrapper, registerWrapper, selectNewAutoMedWrapper, selectNewAutoMedWrapper, setDebugLevel, setOption
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPTION_SCHEMA_NAME

public static final java.lang.String OPTION_SCHEMA_NAME
An option key setting, the value of which should be the SQL schema which is the only one to be mapped in this wrapping

See Also:
Constant Field Values
Constructor Detail

SQLWrapper

public SQLWrapper()
Method Detail

getProtocolName

public java.lang.String getProtocolName()
The name of the Protocol in the repository used to represent JDBC connections.

Specified by:
getProtocolName in class AutoMedWrapper

executeIQL

public ASG executeIQL(ASG q)
               throws DataSourceException
Description copied from class: AutoMedWrapper
Execute an IQL query on the datasource.

Specified by:
executeIQL in class AutoMedWrapper
Parameters:
q - An IQL query held in an ASG which complies with the limitations of what this wrapper is able to process
Returns:
An ASG containing the results of the query
DataSourceException

executeLocalQuery

public AutoMedResult executeLocalQuery(AutoMedQuery q)
                                throws DataSourceException
Description copied from class: AutoMedWrapper
Execute a query in the datasource's native query language, and obtain a result in an AutoMedResult class

Overrides:
executeLocalQuery in class AutoMedWrapper
DataSourceException

connect

protected void connect()
                throws DataSourceException
Connect to a JDBC database in the standard way. Some databases allow you to pass additional parameters when you connect to control certain features, and therefore this method may be overridden.

Specified by:
connect in class AutoMedWrapper
Throws:
DataSourceException - if unable to connect to the data source

executeSQLQuery

public SQLResult executeSQLQuery(SQLQuery q)
                          throws DataSourceException
Execute a query on the data source, returning the result in the standard format for instances of SQL queries.

DataSourceException

getOptionKeys

public java.lang.String[] getOptionKeys()
Return the list of option setting key provided by the wrapper.

Overrides:
getOptionKeys in class AutoMedWrapper