fr.gouv.culture.sdx.utils.rdbms
Class JDBC

java.lang.Object
  extended byfr.gouv.culture.sdx.utils.SdxObjectImpl
      extended byfr.gouv.culture.sdx.utils.rdbms.JDBC
All Implemented Interfaces:
org.apache.avalon.framework.logger.LogEnabled, SdxObject
Direct Known Subclasses:
DataSourceComponentBacked

public abstract class JDBC
extends SdxObjectImpl

Abstract class defining some useful methods for database manipulation


Nested Class Summary
static class JDBC.QueryExecutor
           
protected static class JDBC.Template
           
 
Field Summary
protected  java.lang.String id
           
protected  java.lang.String tableName
           
 
Fields inherited from class fr.gouv.culture.sdx.utils.SdxObjectImpl
encoding, logger
 
Constructor Summary
JDBC()
           
 
Method Summary
protected  void createTable(java.sql.Connection conn)
          Creates the table.
protected abstract  java.lang.String getTableCreationQuery()
          Returns an SQL query that could create the table.
protected  java.lang.String getTableName()
          Returns a table name used to store the repository's data.
protected  java.lang.String handleUnsupportedTokens(java.lang.String name)
          Should return a string after scanning and handling any unsupported characters an identifier (i.e.table name, column name, etc.)
 
Methods inherited from class fr.gouv.culture.sdx.utils.SdxObjectImpl
enableLogging, getChildLogger, setEncoding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected java.lang.String id

tableName

protected java.lang.String tableName
Constructor Detail

JDBC

public JDBC()
Method Detail

getTableName

protected java.lang.String getTableName()
Returns a table name used to store the repository's data.

Returns:
The table name should be appropriately escaped for table building.

getTableCreationQuery

protected abstract java.lang.String getTableCreationQuery()
Returns an SQL query that could create the table.

This query should not have any parameter.

Returns:
The query. see subclasses for implementation

createTable

protected void createTable(java.sql.Connection conn)
                    throws SDXException
Creates the table.

Throws:
SDXException

handleUnsupportedTokens

protected java.lang.String handleUnsupportedTokens(java.lang.String name)
Should return a string after scanning and handling any unsupported characters an identifier (i.e.table name, column name, etc.)

Parameters:
name - The name to prepare for use
Returns:


Copyright © 2000-2004 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.