de.ispsoft.jaxme.util
Class OraLob

java.lang.Object
  extended byde.ispsoft.jaxme.util.OraLob

public class OraLob
extends java.lang.Object

Helper class for working with Lobs on Oracle.

Author:
Jochen Wiedmann

Constructor Summary
OraLob()
           
 
Method Summary
static byte[] getContent(java.sql.Blob pBlob)
          Reads data from a BLOB returned by the database.
static java.lang.String getContent(java.sql.Clob pClob)
          Reads data from a CLOB returned by the database.
static java.lang.String getURLDecodedContent(java.sql.Clob pClob)
           
static java.sql.Blob prepareBLOB(java.sql.Connection pConn, byte[] pBinData)
          The Oracle driver doesn't accept arbitrary implementations of BLOB.
static java.sql.Clob prepareCLOB(java.sql.Connection pConn, java.lang.String pCharData)
          The Oracle driver doesn't accept arbitrary implementations of CLOB.
static java.sql.Clob prepareURLEncodedCLOB(java.sql.Connection pConn, java.lang.String pCharData)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OraLob

public OraLob()
Method Detail

prepareBLOB

public static java.sql.Blob prepareBLOB(java.sql.Connection pConn,
                                        byte[] pBinData)
                                 throws java.sql.SQLException

The Oracle driver doesn't accept arbitrary implementations of BLOB. It requires special instances, returned by this method.

Parameters:
pConn - The connection
pBinData - An array with binary data.
Returns:
A BLOB suitable for use with PreparedStatement#setBlob(int, java.sql.Blob).
Throws:
java.sql.SQLException
See Also:
"http://otn.oracle.com/sample_code/tech/java/codesnippet/xmldb/Example_Code.html"

getContent

public static byte[] getContent(java.sql.Blob pBlob)
                         throws java.sql.SQLException

Reads data from a BLOB returned by the database.

Parameters:
pBlob -
Returns:
Throws:
java.sql.SQLException

prepareCLOB

public static java.sql.Clob prepareCLOB(java.sql.Connection pConn,
                                        java.lang.String pCharData)
                                 throws java.sql.SQLException

The Oracle driver doesn't accept arbitrary implementations of CLOB. It requires special instances, returned by this method.

Parameters:
pConn - The connection
pCharData - An array with character data.
Returns:
A CLOB suitable for use with PreparedStatement#setClob(int, java.sql.Clob).
Throws:
java.sql.SQLException
See Also:
"http://otn.oracle.com/sample_code/tech/java/codesnippet/xmldb/Example_Code.html"

getContent

public static java.lang.String getContent(java.sql.Clob pClob)
                                   throws java.sql.SQLException

Reads data from a CLOB returned by the database.

Throws:
java.sql.SQLException

prepareURLEncodedCLOB

public static java.sql.Clob prepareURLEncodedCLOB(java.sql.Connection pConn,
                                                  java.lang.String pCharData)
                                           throws java.sql.SQLException
Throws:
java.sql.SQLException

getURLDecodedContent

public static java.lang.String getURLDecodedContent(java.sql.Clob pClob)
                                             throws java.sql.SQLException
Throws:
java.sql.SQLException