xmlBlaster 2.2.0 contributions API

org.xmlBlaster.contrib.db
Class DbMetaHelper

java.lang.Object
  extended by org.xmlBlaster.contrib.db.DbMetaHelper

public class DbMetaHelper
extends java.lang.Object

DbMetaHelper offers methods which take care of stuff specific to particular databases. For example if a database stores table names in uppercase you don't need to bother about this knowledge. You just pass the name of the table to the method getUnquotedIdentifier and you get back the correct name (if uppercase it will be uppercase).

Author:
Michele Laghi

Constructor Summary
DbMetaHelper(I_DbPool pool)
          Initializes the object by reading the metadata of this database.
 
Method Summary
 java.lang.String createFunctionName(java.lang.String prefix, java.lang.String separator, java.lang.String schema, java.lang.String tableName)
          If the name is too long it cuts first from the end of the schema, and then from the end of the table name.
 java.lang.String[] getColumnNames(I_DbPool pool, java.lang.String catalog, java.lang.String schema, java.lang.String table)
          Returns an array of column names correctly sorted of the specified table.
 java.lang.String getIdentifier(java.lang.String proposedName)
          Returns the correct identifier depending on the properties of the database.
 boolean isOracle()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbMetaHelper

public DbMetaHelper(I_DbPool pool)
             throws java.lang.Exception
Initializes the object by reading the metadata of this database.

Parameters:
pool - the pool must be non null and initialized.
Throws:
java.lang.Exception - If a backend exception occurs.
Method Detail

getColumnNames

public java.lang.String[] getColumnNames(I_DbPool pool,
                                         java.lang.String catalog,
                                         java.lang.String schema,
                                         java.lang.String table)
                                  throws java.lang.Exception
Returns an array of column names correctly sorted of the specified table. Never returns null, if no columns found it returns an empty array.

Throws:
java.lang.Exception - If a backend exception occurs.

getIdentifier

public java.lang.String getIdentifier(java.lang.String proposedName)
Returns the correct identifier depending on the properties of the database. If it can not determine the case of the identifier it returns null.

Parameters:
proposedName - the name which is proposed.
Returns:

createFunctionName

public java.lang.String createFunctionName(java.lang.String prefix,
                                           java.lang.String separator,
                                           java.lang.String schema,
                                           java.lang.String tableName)
If the name is too long it cuts first from the end of the schema, and then from the end of the table name. Otherwise it is ${PREFIX}${SEP}${SCHEMA}${SEP}${TABLENAME}

Parameters:
schema -
tableName -
Returns:

isOracle

public boolean isOracle()

xmlBlaster 2.2.0 contributions API

Copyright © 1999-2014 The xmlBlaster.org contributers.