net.wgen.op.db.lob
Class LobHandler

java.lang.Object
  extended bynet.wgen.op.db.lob.LobHandler
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
JbossLobHandler, MySqlLobHandler, OracleLobHandler

public class LobHandler
extends java.lang.Object
implements java.io.Serializable

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

Field Summary
static int LOB_CHUNK_SIZE
           
private static org.apache.log4j.Logger LOG
           
static int MAX_LOB_SIZE
           
static int MAX_ROWS_ALLOWED
           
static int MAX_ROWS_WARNED
           
 
Constructor Summary
LobHandler()
           
 
Method Summary
 java.sql.Blob makeBlob(java.sql.Connection connection, java.io.InputStream dataStream, int length)
           
 java.sql.Clob makeClob(java.sql.Connection connection, java.lang.String value)
           
 int readBlob(java.sql.Blob blob, java.io.OutputStream receptacleStream)
           
 java.lang.String readClob(java.sql.Clob clob)
          Read text from a CLOB into a String
 void setArray(java.sql.PreparedStatement statement, int index, java.lang.Object[] array, java.lang.String arrayDescriptor)
           
 void setBlob(java.sql.PreparedStatement statement, int index, java.io.InputStream dataStream, int length)
           
 void setClob(java.sql.PreparedStatement statement, int index, java.lang.String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final transient org.apache.log4j.Logger LOG

MAX_ROWS_ALLOWED

public static final int MAX_ROWS_ALLOWED
See Also:
Constant Field Values

MAX_ROWS_WARNED

public static final int MAX_ROWS_WARNED
See Also:
Constant Field Values

LOB_CHUNK_SIZE

public static final int LOB_CHUNK_SIZE
See Also:
Constant Field Values

MAX_LOB_SIZE

public static final int MAX_LOB_SIZE
See Also:
Constant Field Values
Constructor Detail

LobHandler

public LobHandler()
Method Detail

readClob

public java.lang.String readClob(java.sql.Clob clob)
                          throws java.sql.SQLException,
                                 java.io.IOException
Read text from a CLOB into a String

Parameters:
clob - the clob from which to read, a null Clob will return null
Returns:
the string representation of the data contained in the Clob
Throws:
java.sql.SQLException
java.io.IOException - if there is an error reading from the Clob's stream
java.lang.UnsupportedOperationException - the clob is not a oracle.sql.CLOB or a java.sql.Clob

makeClob

public java.sql.Clob makeClob(java.sql.Connection connection,
                              java.lang.String value)
                       throws java.sql.SQLException
Parameters:
connection -
value -
Returns:
Throws:
java.sql.SQLException

setClob

public void setClob(java.sql.PreparedStatement statement,
                    int index,
                    java.lang.String value)
             throws java.sql.SQLException
Parameters:
statement -
index -
value -
Throws:
java.sql.SQLException

readBlob

public int readBlob(java.sql.Blob blob,
                    java.io.OutputStream receptacleStream)
             throws java.sql.SQLException,
                    java.io.IOException
Parameters:
blob -
receptacleStream -
Returns:
Throws:
java.sql.SQLException
java.io.IOException

makeBlob

public java.sql.Blob makeBlob(java.sql.Connection connection,
                              java.io.InputStream dataStream,
                              int length)
                       throws java.sql.SQLException
Parameters:
connection -
dataStream -
Returns:
Throws:
java.sql.SQLException

setBlob

public void setBlob(java.sql.PreparedStatement statement,
                    int index,
                    java.io.InputStream dataStream,
                    int length)
             throws java.sql.SQLException
Parameters:
statement -
index -
dataStream -
Throws:
java.sql.SQLException

setArray

public void setArray(java.sql.PreparedStatement statement,
                     int index,
                     java.lang.Object[] array,
                     java.lang.String arrayDescriptor)
              throws java.sql.SQLException
Parameters:
statement -
index -
array -
arrayDescriptor -
Throws:
java.sql.SQLException