org.lexevs.dao.database.connection
Class SQLInterface

java.lang.Object
  extended by org.lexevs.dao.database.connection.SQLInterface

public class SQLInterface
extends java.lang.Object

Code to access the specific sql tables for a terminology. Multiple instances of this class may use the same SQLInterfaceBase (in SINGLE_DB_MODE)

Version:
subversion $Revision: $ checked in on $Date: $
Author:
Dan Armbrust, Jesse Erdmann

Constructor Summary
SQLInterface(javax.sql.DataSource dataSource, DatabaseType databaseType, java.lang.String tablePrefix)
          Instantiates a new sQL interface.
SQLInterface(java.lang.String codingSchemeUri, java.lang.String version)
           
 
Method Summary
 void checkInPreparedStatement(java.sql.PreparedStatement statement)
          Check in prepared statement.
 java.sql.PreparedStatement checkOutPreparedStatement(java.lang.String sql)
          Check out prepared statement.
 void dropTables()
          Drop tables.
 java.lang.String getKey()
          Gets the key.
protected  LgLoggerIF getLogger()
          Gets the logger.
 SQLTableConstants getSQLTableConstants()
          Gets the sQL table constants.
 SQLTableUtilities getSQLTableUtilities()
          Deprecated. 
 java.lang.String getTableName(java.lang.String tableKey)
          Gets the table name.
 java.lang.String getTablePrefix()
          Return the table prefix that this SQL Interface is accessing.
 java.sql.PreparedStatement modifyAndCheckOutPreparedStatement(java.lang.String sql)
          Modify and check out prepared statement.
 boolean supports2009Model()
          Supports2009 model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLInterface

public SQLInterface(javax.sql.DataSource dataSource,
                    DatabaseType databaseType,
                    java.lang.String tablePrefix)
Instantiates a new sQL interface.

Parameters:
dataSource - the data source
databaseType - the database type
tablePrefix - the table prefix

SQLInterface

public SQLInterface(java.lang.String codingSchemeUri,
                    java.lang.String version)
Method Detail

getLogger

protected LgLoggerIF getLogger()
Gets the logger.

Returns:
the logger

getSQLTableUtilities

@Deprecated
public SQLTableUtilities getSQLTableUtilities()
Deprecated. 

Gets the sQL table utilities.

Returns:
the sQL table utilities

supports2009Model

public boolean supports2009Model()
Supports2009 model.

Returns:
true, if successful

getSQLTableConstants

public SQLTableConstants getSQLTableConstants()
Gets the sQL table constants.

Returns:
the sQL table constants

getTableName

public java.lang.String getTableName(java.lang.String tableKey)
Gets the table name.

Parameters:
tableKey - the table key
Returns:
the table name

modifyAndCheckOutPreparedStatement

public java.sql.PreparedStatement modifyAndCheckOutPreparedStatement(java.lang.String sql)
                                                              throws java.sql.SQLException
Modify and check out prepared statement.

Parameters:
sql - the sql
Returns:
the prepared statement
Throws:
java.sql.SQLException - the SQL exception

checkOutPreparedStatement

public java.sql.PreparedStatement checkOutPreparedStatement(java.lang.String sql)
                                                     throws java.sql.SQLException
Check out prepared statement.

Parameters:
sql - the sql
Returns:
the prepared statement
Throws:
java.sql.SQLException - the SQL exception

checkInPreparedStatement

public void checkInPreparedStatement(java.sql.PreparedStatement statement)
Check in prepared statement.

Parameters:
statement - the statement

dropTables

public void dropTables()
                throws java.sql.SQLException
Drop tables.

Throws:
java.sql.SQLException - the SQL exception

getTablePrefix

public java.lang.String getTablePrefix()
Return the table prefix that this SQL Interface is accessing.

Returns:
the table prefix

getKey

public java.lang.String getKey()
Gets the key.

Returns:
the key

Copyright: (c) 2004-2006 Mayo Foundation for Medical Education and Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the triple-shield Mayo logo are trademarks and service marks of MFMER.