SPT Core API

com.sptci.echo2.table
Class ResultSetMetaDataProxy

java.lang.Object
  extended by com.sptci.echo2.table.ResultSetMetaDataProxy
All Implemented Interfaces:
InvocationHandler

public class ResultSetMetaDataProxy
extends Object
implements InvocationHandler

A proxy ResultSetMetaData to return non-negative values for the ResultSetMetaData.getScale(int) method.

© Copyright 2007 Sans Pareil Technologies, Inc.

Version:
$Id: ResultSetMetaDataProxy.java 4553 2008-12-24 10:34:16Z rakesh $
Author:
Rakesh Vidyadharan 2007-10-22

Method Summary
static ResultSetMetaData createMetaData(ResultSetMetaData metadata)
          Returns a proxy meta data which returns a non-negative scale value for number columns.
 Object invoke(Object proxy, Method method, Object[] parameters)
          The InvocationHandler implementation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createMetaData

public static ResultSetMetaData createMetaData(ResultSetMetaData metadata)
Returns a proxy meta data which returns a non-negative scale value for number columns.

Parameters:
metadata - The meta data that is to be proxied.
Returns:
The proxied instance.

invoke

public Object invoke(Object proxy,
                     Method method,
                     Object[] parameters)
              throws SQLException
The InvocationHandler implementation. Passes through to metadata except for invocation of the ResultSetMetaData.getScale(int) method which returns a non-negative value for all cases.

Specified by:
invoke in interface InvocationHandler
Parameters:
proxy - This proxy instance.
method - The method that is to be executed.
parameters - The parameters to pass to the method.
Throws:
SQLException - If errors are encountered while invoking the method.

SPT Core API