net.wgen.op.db
Class SQLDataParameter

java.lang.Object
  extended bynet.wgen.op.db.Parameter
      extended bynet.wgen.op.db.SQLDataParameter
All Implemented Interfaces:
java.io.Serializable

public class SQLDataParameter
extends Parameter

Wrapper Parameter class for SQLData objects. This has been tested in Oracle, and I don't believe mysql implements this functionality of the JDBC interface (January 2007).

If you have a SQLData object, you can use this to wrap it. This code in, for example, wraps a SQLData object, and delegates preparation call to the object which it needs to transform the inner SQLData objects into SQLData objects using the Connection. You might need this if your SQLData object has a Clob inside it. You can set the value as a String, which doesn't require a connection, and then before execution, you can change that String into the Clob using the Connection. This is an exception to the Connection protection provided by the rest of the framework.

 MySQLDataImpl myobj = new MySQLDataImpl( value1, value2 );
 SQLDataParameter myobjParam = new SQLDataParameter( myobj )
 {
      protected void prepare( Connection cx )
         throws SQLException
      {
          ((MySQLDataImpl) getValue() ).prepareMyClobWithConnection( cx );
      }
 };
 

Version:
$Id: SQLDataParameter.html,v 1.2 2007/01/28 04:09:36 paulfeuer Exp $
Author:
Paul Feuer, Wireless Generation, Inc.
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.wgen.op.db.Parameter
DIR_IN, DIR_INOUT, DIR_OUT, TYPE_NOT_SET
 
Constructor Summary
SQLDataParameter(int type)
          Constructor for an implicit Out Parameter.
SQLDataParameter(java.sql.SQLData value)
          Constructor for an implicit In Parameter.
SQLDataParameter(java.sql.SQLData value, int type, int direction)
          Full constructor.
 
Method Summary
protected  void prepare(java.sql.Connection connection)
          Perform any prep work requiring the connection.
 
Methods inherited from class net.wgen.op.db.Parameter
getDirection, getJdbcType, getOptions, getValue, nullableNumeric, nullableNumeric, nullableString, nullableString, setOptions, setValue, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SQLDataParameter

public SQLDataParameter(java.sql.SQLData value)
Constructor for an implicit In Parameter.

Parameters:
value -

SQLDataParameter

public SQLDataParameter(java.sql.SQLData value,
                        int type,
                        int direction)
Full constructor.

Parameters:
value -
type -
direction -

SQLDataParameter

public SQLDataParameter(int type)
Constructor for an implicit Out Parameter.

Parameters:
type -
Method Detail

prepare

protected void prepare(java.sql.Connection connection)
                throws java.sql.SQLException
Perform any prep work requiring the connection.

Parameters:
connection -
Throws:
java.sql.SQLException