MDi JLib
1.7.4

com.microdeveloper.data
Class OracleClob

java.lang.Object
  extended by com.microdeveloper.data.OracleClob
All Implemented Interfaces:
OracleClobInterface

public class OracleClob
extends Object
implements OracleClobInterface

Extends the Oracle CLOB interface to allow for operations that are currently unsupported in the Oracle driver.

Version Notes:

Since:
1.2
Version:
1.0
Author:
Gregg Lagnese

Constructor Summary
OracleClob()
          Creates a new instance of OracleClob
OracleClob(Clob c)
          Creates a new instance of Clob using a given java.sql.Clob
OracleClob(CLOB c)
          Creates a new instance of Clob using a given oracle.sql.CLOB
 
Method Summary
 void setClob(Clob c)
          Sets this Clob to the given java.sql.Clob
 void setClob(CLOB c)
          Sets this Clob to the given oracle.sql.CLOB
 void setClob(String s)
          Sets this Clob to the given String
static Clob toClob(String s)
          Converts a string to a java.sql.Clob object
static CLOB toCLOB(String s)
          Converts a string to a oracle.sql.CLOB object
 String toString()
          Converts this Clob to a String.
static String toString(Clob c)
          Converts java.sql.Clob c to a String.
static String toString(CLOB c)
          Converts oracle.sql.CLOB c to a String.
 void truncate()
          Clears the CLOB but does not make the Clob null
 CLOB truncate(CLOB c)
          Clears the given CLOB but does not make the Clob null
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OracleClob

public OracleClob()
Creates a new instance of OracleClob


OracleClob

public OracleClob(CLOB c)
Creates a new instance of Clob using a given oracle.sql.CLOB

Parameters:
c - the CLOB to use when instantiated

OracleClob

public OracleClob(Clob c)
Creates a new instance of Clob using a given java.sql.Clob

Parameters:
c - the CLOB to use when instantiated
Method Detail

toString

public String toString()
Converts this Clob to a String. If the object is empty then a null String is returned. The the Clob cannot be read, null is returned.

Specified by:
toString in interface OracleClobInterface
Overrides:
toString in class Object
Returns:
the String version of the CLOB

toString

public static String toString(CLOB c)
Converts oracle.sql.CLOB c to a String. If the CLOB is empty then a null String is returned. The the CLOB cannot be read, null is returned.

Parameters:
c - CLOB to be converted
Returns:
converted CLOB as a string

toString

public static String toString(Clob c)
Converts java.sql.Clob c to a String. If the CLOB is empty then a null String is returned. The the CLOB cannot be read, null is returned.

Parameters:
c - CLOB to be converted
Returns:
converted CLOB as a string

toCLOB

public static CLOB toCLOB(String s)
                   throws SQLException
Converts a string to a oracle.sql.CLOB object

Parameters:
s - String to convert
Returns:
Converted String as a oracle.sql.CLOB
Throws:
SQLException - thrown if the conversion fails

toClob

public static Clob toClob(String s)
                   throws SQLException
Converts a string to a java.sql.Clob object

Parameters:
s - String to convert
Returns:
Converted String as a java.sql.Clob
Throws:
SQLException - thrown if the conversion fails

setClob

public void setClob(CLOB c)
             throws SQLException
Sets this Clob to the given oracle.sql.CLOB

Specified by:
setClob in interface OracleClobInterface
Parameters:
c - the CLOB to mirror
Throws:
SQLException - thrown if the conversion fails

setClob

public void setClob(Clob c)
             throws SQLException
Sets this Clob to the given java.sql.Clob

Parameters:
c - the CLOB to mirror
Throws:
SQLException - thrown if the conversion fails

setClob

public void setClob(String s)
             throws SQLException
Sets this Clob to the given String

Specified by:
setClob in interface OracleClobInterface
Parameters:
s - the String to set the Clob to
Throws:
SQLException - thrown if the conversion fails

truncate

public void truncate()
              throws SQLException
Clears the CLOB but does not make the Clob null

Specified by:
truncate in interface OracleClobInterface
Throws:
SQLException - thrown if the Clob cannot be cleared or has not been initialized

truncate

public CLOB truncate(CLOB c)
              throws SQLException
Clears the given CLOB but does not make the Clob null

Specified by:
truncate in interface OracleClobInterface
Parameters:
c - CLOB to truncate
Returns:
Empty but not null CLOB
Throws:
SQLException - Thrown if the attempt to clear the CLOB fails

MDi JLib
1.7.4

Copyright©2001-2007 MicroDeveloper, Inc. All Rights Reserved.