com.altair.hwm.database.sql
Class HWMClobDB

java.lang.Object
  extended by com.altair.hwm.database.sql.HWMClobDB
All Implemented Interfaces:
java.io.Serializable, java.sql.Clob

public class HWMClobDB
extends java.lang.Object
implements java.sql.Clob, java.io.Serializable

Title: HWMClobDB

Description: The clob implementation for embedded databases

Company: Altair Engineering, Inc.

See Also:
Serialized Form

Constructor Summary
HWMClobDB()
          Constructor
HWMClobDB(char[] arrChars)
          Constructor
HWMClobDB(java.sql.Clob clob)
          Constructor
 
Method Summary
 java.io.InputStream getAsciiStream()
          Gets the CLOB value designated by this Clob object as a stream of Ascii bytes.
 java.io.Reader getCharacterStream()
          Gets the CLOB value designated by this Clob object as a Unicode stream.
 java.lang.String getSubString(long nPos, int nLength)
          Returns a copy of the specified substring in the CLOB value designated by this Clob object.
 long length()
          Returns the number of characters in the CLOB value designated by this Clob object.
 long position(java.sql.Clob strSearch, long nStart)
          Determines the character position at which the specified Clob object searchstr appears in this Clob object.
 long position(java.lang.String strSearch, long nStart)
          Determines the character position at which the specified substring searchstr appears in the SQL CLOB value represented by this Clob object.
 java.io.OutputStream setAsciiStream(long pos)
           
 java.io.Writer setCharacterStream(long pos)
           
 int setString(long pos, java.lang.String str)
           
 int setString(long pos, java.lang.String str, int offset, int len)
           
 java.lang.String toString()
          Returns a string representation of this class
 void truncate(long len)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HWMClobDB

public HWMClobDB()
Constructor


HWMClobDB

public HWMClobDB(java.sql.Clob clob)
          throws java.sql.SQLException
Constructor

Parameters:
clob - The clob to store
Throws:
java.sql.SQLException

HWMClobDB

public HWMClobDB(char[] arrChars)
          throws java.sql.SQLException
Constructor

Parameters:
char[] - The character array to store
Throws:
java.sql.SQLException
Method Detail

toString

public java.lang.String toString()
Returns a string representation of this class

Overrides:
toString in class java.lang.Object
Returns:
String The string representation

length

public long length()
            throws java.sql.SQLException
Returns the number of characters in the CLOB value designated by this Clob object.

Specified by:
length in interface java.sql.Clob
Returns:
length of the CLOB in characters
Throws:
java.sql.SQLException - if there is an error accessing the length of the CLOB
Since:
1.2
See Also:
What Is in the JDBC 2.0 API

getSubString

public java.lang.String getSubString(long nPos,
                                     int nLength)
                              throws java.sql.SQLException
Returns a copy of the specified substring in the CLOB value designated by this Clob object. The substring begins at position pos and has up to length consecutive characters.

Specified by:
getSubString in interface java.sql.Clob
Parameters:
nPos - the first character of the substring to be extracted. The first character is at position 1.
nLength - the number of consecutive characters to be copied
Returns:
a String that is the specified substring in the CLOB value designated by this Clob object
Throws:
java.sql.SQLException - if there is an error accessing the CLOB
Since:
1.2
See Also:
What Is in the JDBC 2.0 API

getCharacterStream

public java.io.Reader getCharacterStream()
                                  throws java.sql.SQLException
Gets the CLOB value designated by this Clob object as a Unicode stream.

Specified by:
getCharacterStream in interface java.sql.Clob
Returns:
a Unicode stream containing the CLOB data
Throws:
java.sql.SQLException - if there is an error accessing the CLOB value
Since:
1.2
See Also:
What Is in the JDBC 2.0 API

getAsciiStream

public java.io.InputStream getAsciiStream()
                                   throws java.sql.SQLException
Gets the CLOB value designated by this Clob object as a stream of Ascii bytes.

Specified by:
getAsciiStream in interface java.sql.Clob
Returns:
an ascii stream containing the CLOB data
Throws:
java.sql.SQLException - if there is an error accessing the CLOB value
Since:
1.2
See Also:
What Is in the JDBC 2.0 API

position

public long position(java.lang.String strSearch,
                     long nStart)
              throws java.sql.SQLException
Determines the character position at which the specified substring searchstr appears in the SQL CLOB value represented by this Clob object. The search begins at position start.

Specified by:
position in interface java.sql.Clob
Parameters:
strSearch - the substring for which to search
nStart - the position at which to begin searching; the first position is 1
Returns:
the position at which the substring appears, else -1; the first position is 1
Throws:
java.sql.SQLException - if there is an error accessing the CLOB value
Since:
1.2
See Also:
What Is in the JDBC 2.0 API

position

public long position(java.sql.Clob strSearch,
                     long nStart)
              throws java.sql.SQLException
Determines the character position at which the specified Clob object searchstr appears in this Clob object. The search begins at position start.

Specified by:
position in interface java.sql.Clob
Parameters:
strSearch - the Clob object for which to search
nStart - the position at which to begin searching; the first position is 1
Returns:
the position at which the Clob object appears, else -1; the first position is 1
Throws:
java.sql.SQLException - if there is an error accessing the CLOB value
Since:
1.2
See Also:
What Is in the JDBC 2.0 API

truncate

public void truncate(long len)
              throws java.sql.SQLException
Specified by:
truncate in interface java.sql.Clob
Throws:
java.sql.SQLException

setAsciiStream

public java.io.OutputStream setAsciiStream(long pos)
                                    throws java.sql.SQLException
Specified by:
setAsciiStream in interface java.sql.Clob
Throws:
java.sql.SQLException

setCharacterStream

public java.io.Writer setCharacterStream(long pos)
                                  throws java.sql.SQLException
Specified by:
setCharacterStream in interface java.sql.Clob
Throws:
java.sql.SQLException

setString

public int setString(long pos,
                     java.lang.String str)
              throws java.sql.SQLException
Specified by:
setString in interface java.sql.Clob
Throws:
java.sql.SQLException

setString

public int setString(long pos,
                     java.lang.String str,
                     int offset,
                     int len)
              throws java.sql.SQLException
Specified by:
setString in interface java.sql.Clob
Throws:
java.sql.SQLException