org.afcs.warts.handlers
Class DataHandlerFactory

java.lang.Object
  extended byorg.afcs.warts.handlers.DataHandlerFactory

public final class DataHandlerFactory
extends java.lang.Object

The DataHandlerFactory class is the factory that is responsible for converting the SQL type and name returned by loading the table metadata into an DataHandler implementation that is appropriate for that type. Currently the analysis is based purely on the Oracle column types.

Due to what appears to be a bug in Oracle's JDBC driver which prevents the loading of a LONG column value and a LOB column value from the same ResultSet row, Oracle's LONG column type is not supported. See my post to Oracle's JDBC forum for more information.

LICENSE: This code is released to the public domain and may be used for any purpose whatsoever without permission or acknowledgment.

Version:
Last Modified 20 August 2003
Author:
Warren Hedley ( whedley at sdsc dot edu )

Method Summary
static DataHandler getDataHandler(TableDescription tableDescription, ColumnDescription columnDescription)
          Given a column description (which provides the SQL type and name generated from loading table metadata), this method constructs and returns a DataHandler implementation that can read and write data for the specified column.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDataHandler

public static DataHandler getDataHandler(TableDescription tableDescription,
                                         ColumnDescription columnDescription)
Given a column description (which provides the SQL type and name generated from loading table metadata), this method constructs and returns a DataHandler implementation that can read and write data for the specified column. If the combination of type and name is not recognised, then a warning is logged, and a NullHandler is returned.

Parameters:
tableDescription - The table that the handler will be handling data for.
columnDescription - The column to return a handler for.
Returns:
A data handler appropriate for the specified column, or a NullHandler if the column configuration isn't recognised.
Throws:
java.lang.IllegalArgumentException - If columnDescription is null.