Package org.teiid.core.types
Class ClobImpl
- java.lang.Object
-
- org.teiid.core.types.BaseLob
-
- org.teiid.core.types.ClobImpl
-
- All Implemented Interfaces:
Externalizable,Serializable,Clob,InputStreamFactory.StreamFactoryReference
public class ClobImpl extends BaseLob implements Clob
This object holds a chunk of char data and implements the JDBC Clob interface. This object presents a streaming interface and provides a way to access partial of the Clob data. Connectors can use this object when dealing with large objects.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ClobcreateClob(char[] chars)InputStreamgetAsciiStream()ReadergetCharacterStream(long arg0, long arg1)StringgetSubString(long pos, int length)longlength()Returns the number of characters in theCLOBvalue designated by thisClobobject.longposition(String searchstr, long start)Determines the character position at which the specified substringsearchstrappears in the SQLCLOBvalue represented by thisClobobject.longposition(Clob searchstr, long start)Determines the character position at which the specifiedClobobjectsearchstrappears in thisClobobject.OutputStreamsetAsciiStream(long arg0)WritersetCharacterStream(long arg0)intsetString(long arg0, String arg1)intsetString(long arg0, String arg1, int arg2, int arg3)voidtruncate(long arg0)-
Methods inherited from class org.teiid.core.types.BaseLob
free, getBinaryStream, getCharacterStream, getCharset, getStreamFactory, readExternal, setCharset, setEncoding, setStreamFactory, writeExternal
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.sql.Clob
free, getCharacterStream
-
-
-
-
Constructor Detail
-
ClobImpl
public ClobImpl()
-
ClobImpl
public ClobImpl(InputStreamFactory streamFactory, long length)
Creates a new ClobImpl. Note that the length is not taken from theInputStreamFactorysince it refers to bytes and not chars.- Parameters:
streamFactory-length-
-
ClobImpl
public ClobImpl(char[] chars)
-
ClobImpl
public ClobImpl(String str)
-
-
Method Detail
-
getAsciiStream
public InputStream getAsciiStream() throws SQLException
- Specified by:
getAsciiStreamin interfaceClob- Throws:
SQLException
-
getSubString
public String getSubString(long pos, int length) throws SQLException
- Specified by:
getSubStringin interfaceClob- Throws:
SQLException
-
length
public long length() throws SQLExceptionReturns the number of characters in theCLOBvalue designated by thisClobobject.- Specified by:
lengthin interfaceClob- Overrides:
lengthin classBaseLob- Returns:
- length of the
CLOBin characters - Throws:
SQLException
-
position
public long position(Clob searchstr, long start) throws SQLException
Determines the character position at which the specifiedClobobjectsearchstrappears in thisClobobject. The search begins at positionstart.- Specified by:
positionin interfaceClob- Parameters:
searchstr- theClobobject for which to searchstart- the position at which to begin searching; the first position is 1- Returns:
- the position at which the
Clobobject appears, else -1; the first position is 1 - Throws:
SQLException
-
position
public long position(String searchstr, long start) throws SQLException
Determines the character position at which the specified substringsearchstrappears in the SQLCLOBvalue represented by thisClobobject. The search begins at positionstart.- Specified by:
positionin interfaceClob- Parameters:
searchstr- the substring for which to searchstart- 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:
SQLException- if there is an error accessing theCLOBvalue
-
getCharacterStream
public Reader getCharacterStream(long arg0, long arg1) throws SQLException
- Specified by:
getCharacterStreamin interfaceClob- Throws:
SQLException
-
setAsciiStream
public OutputStream setAsciiStream(long arg0) throws SQLException
- Specified by:
setAsciiStreamin interfaceClob- Throws:
SQLException
-
setCharacterStream
public Writer setCharacterStream(long arg0) throws SQLException
- Specified by:
setCharacterStreamin interfaceClob- Throws:
SQLException
-
setString
public int setString(long arg0, String arg1) throws SQLException- Specified by:
setStringin interfaceClob- Throws:
SQLException
-
setString
public int setString(long arg0, String arg1, int arg2, int arg3) throws SQLException- Specified by:
setStringin interfaceClob- Throws:
SQLException
-
truncate
public void truncate(long arg0) throws SQLException- Specified by:
truncatein interfaceClob- Throws:
SQLException
-
createClob
public static Clob createClob(char[] chars)
-
-