Java Doc for SerialClob.java in  » 6.0-JDK-Core » sql » javax » sql » rowset » serial » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » sql » javax.sql.rowset.serial 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.sql.rowset.serial.SerialClob

SerialClob
public class SerialClob implements Clob,Serializable,Cloneable(Code)
A serialized mapping in the Java programming language of an SQL CLOB value.

The SerialClob class provides a constructor for creating an instance from a Clob object. Note that the Clob object should have brought the SQL CLOB value's data over to the client before a SerialClob object is constructed from it. The data of an SQL CLOB value can be materialized on the client as a stream of Unicode characters.

SerialClob methods make it possible to get a substring from a SerialClob object or to locate the start of a pattern of characters.
author:
   Jonathan Bruce



Field Summary
final static  longserialVersionUID
     The identifier that assists in the serialization of this SerialClob object.

Constructor Summary
public  SerialClob(char ch)
     Constructs a SerialClob object that is a serialized version of the given char array.
public  SerialClob(Clob clob)
     Constructs a SerialClob object that is a serialized version of the given Clob object.

The new SerialClob object is initialized with the data from the Clob object; therefore, the Clob object should have previously brought the SQL CLOB value's data over to the client from the database.


Method Summary
public  voidfree()
    
public  java.io.InputStreamgetAsciiStream()
     Retrieves the CLOB value designated by this SerialClob object as an ascii stream.
public  java.io.ReadergetCharacterStream()
     Returns this SerialClob object's data as a stream of Unicode characters.
public  ReadergetCharacterStream(long pos, long length)
    
public  StringgetSubString(long pos, int length)
     Returns a copy of the substring contained in this SerialClob object, starting at the given position and continuing for the specified number or characters.
public  longlength()
     Retrieves the number of characters in this SerialClob object's array of characters.
public  longposition(String searchStr, long start)
     Returns the position in this SerialClob object where the given String object begins, starting the search at the specified position.
public  longposition(Clob searchStr, long start)
     Returns the position in this SerialClob object where the given Clob signature begins, starting the search at the specified position.
public  java.io.OutputStreamsetAsciiStream(long pos)
     Retrieves a stream to be used to write Ascii characters to the CLOB value that this SerialClob object represents, starting at position pos.
public  java.io.WritersetCharacterStream(long pos)
     Retrieves a stream to be used to write a stream of Unicode characters to the CLOB value that this SerialClob object represents, at position pos.
public  intsetString(long pos, String str)
     Writes the given Java String to the CLOB value that this SerialClob object represents, at the position pos.
public  intsetString(long pos, String str, int offset, int length)
     Writes len characters of str, starting at character offset, to the CLOB value that this Clob represents.
public  voidtruncate(long length)
     Truncates the CLOB value that this SerialClob object represents so that it has a length of len characters.

Field Detail
serialVersionUID
final static long serialVersionUID(Code)
The identifier that assists in the serialization of this SerialClob object.




Constructor Detail
SerialClob
public SerialClob(char ch) throws SerialException, SQLException(Code)
Constructs a SerialClob object that is a serialized version of the given char array.

The new SerialClob object is initialized with the data from the char array, thus allowing disconnected RowSet objects to establish a serialized Clob object without touching the data source.
Parameters:
  ch - the char array representing the Clob object to beserialized
throws:
  SerialException - if an error occurs during serialization
throws:
  SQLException - if a SQL error occurs




SerialClob
public SerialClob(Clob clob) throws SerialException, SQLException(Code)
Constructs a SerialClob object that is a serialized version of the given Clob object.

The new SerialClob object is initialized with the data from the Clob object; therefore, the Clob object should have previously brought the SQL CLOB value's data over to the client from the database. Otherwise, the new SerialClob object object will contain no data.

Note: The Clob object supplied to this constructor cannot return null for the Clob.getCharacterStream() and Clob.getAsciiStream methods. This SerialClob constructor cannot serialize a Clob object in this instance and will throw an SQLException object.
Parameters:
  clob - the Clob object from which thisSerialClob object is to be constructed; cannot be null
throws:
  SerialException - if an error occurs during serialization
throws:
  SQLException - if a SQL error occurs in capturing the CLOB;if the Clob object is a null; or if both the Clob.getCharacterStream() and Clob.getAsciiStream()methods on the Clob return a null
See Also:   java.sql.Clob





Method Detail
free
public void free() throws SQLException(Code)



getAsciiStream
public java.io.InputStream getAsciiStream() throws SerialException, SQLException(Code)
Retrieves the CLOB value designated by this SerialClob object as an ascii stream. This method forwards the getAsciiStream call to the underlying Clob object in the event that this SerialClob object is instantiated with a Clob object. If this SerialClob object is instantiated with a char array, a SerialException object is thrown. a java.io.InputStream object containingthis SerialClob object's data
throws:
  SerialException - if this SerialClob object was not instantiatedwith a Clob object
throws:
  SQLException - if there is an error accessing the CLOB value represented by the Clob object that wasused to create this SerialClob object



getCharacterStream
public java.io.Reader getCharacterStream() throws SerialException(Code)
Returns this SerialClob object's data as a stream of Unicode characters. Unlike the related method, getAsciiStream, a stream is produced regardless of whether the SerialClob object was created with a Clob object or a char array. a java.io.Reader object containing thisSerialClob object's data
throws:
  SerialException - if an error occurs



getCharacterStream
public Reader getCharacterStream(long pos, long length) throws SQLException(Code)



getSubString
public String getSubString(long pos, int length) throws SerialException(Code)
Returns a copy of the substring contained in this SerialClob object, starting at the given position and continuing for the specified number or characters.
Parameters:
  pos - the position of the first character in the substringto be copied; the first character of theSerialClob object is at position1; must not be less than 1,and the sum of the starting position and the lengthof the substring must be less than the length of thisSerialClob object
Parameters:
  length - the number of characters in the substring to bereturned; must not be greater than the length ofthis SerialClob object, and thesum of the starting position and the lengthof the substring must be less than the length of thisSerialClob object a String object containing a substring ofthis SerialClob object beginning at thegiven position and containing the specified number ofconsecutive characters
throws:
  SerialException - if either of the arguments is out of bounds



length
public long length() throws SerialException(Code)
Retrieves the number of characters in this SerialClob object's array of characters. a long indicating the length in characters of thisSerialClob object's array of character
throws:
  SerialException - if an error occurs



position
public long position(String searchStr, long start) throws SerialException, SQLException(Code)
Returns the position in this SerialClob object where the given String object begins, starting the search at the specified position. This method returns -1 if the pattern is not found.
Parameters:
  searchStr - the String object for which tosearch
Parameters:
  start - the position in this SerialClob objectat which to start the search; the first position is1; must not be less than 1 norgreater than the length of this SerialClob object the position at which the given String objectbegins, starting the search at the specified position;-1 if the given String object isnot found or the starting position is out of bounds; positionnumbering for the return value starts at 1
throws:
  SerialException - if an error occurs locating the String signature
throws:
  SQLException - if there is an error accessing the Blob value from the database.



position
public long position(Clob searchStr, long start) throws SerialException, SQLException(Code)
Returns the position in this SerialClob object where the given Clob signature begins, starting the search at the specified position. This method returns -1 if the pattern is not found.
Parameters:
  searchStr - the Clob object for which to search
Parameters:
  start - the position in this SerialClob objectat which to begin the search; the first position is1; must not be less than 1 norgreater than the length of this SerialClob object the position at which the given Clob object begins in this SerialClob object,at or after the specified starting position
throws:
  SerialException - if an error occurs locating the Clob signature
throws:
  SQLException - if there is an error accessing the Blob value from the database



setAsciiStream
public java.io.OutputStream setAsciiStream(long pos) throws SerialException, SQLException(Code)
Retrieves a stream to be used to write Ascii characters to the CLOB value that this SerialClob object represents, starting at position pos. This method forwards the setAsciiStream() call to the underlying Clob object in the event that this SerialClob object is instantiated with a Clob object. If this SerialClob object is instantiated with a char array, a SerialException object is thrown.
Parameters:
  pos - the position at which to start writing to theCLOB object the stream to which ASCII encoded characters can be written
throws:
  SerialException - if SerialClob is not instantiated with aClob object that supports setAsciiStream
throws:
  SQLException - if there is an error accessing the CLOB value
See Also:   SerialClob.getAsciiStream



setCharacterStream
public java.io.Writer setCharacterStream(long pos) throws SerialException, SQLException(Code)
Retrieves a stream to be used to write a stream of Unicode characters to the CLOB value that this SerialClob object represents, at position pos. This method forwards the setCharacterStream() call to the underlying Clob object in the event that this SerialClob object is instantiated with a Clob object. If this SerialClob object is instantiated with a char array, a SerialException is thrown.
Parameters:
  pos - the position at which to start writing to theCLOB value a stream to which Unicode encoded characters can be written
throws:
  SerialException - if the SerialClob is not instantiated witha Clob object that supports setCharacterStream
throws:
  SQLException - if there is an error accessing the CLOB value
See Also:   SerialClob.getCharacterStream



setString
public int setString(long pos, String str) throws SerialException(Code)
Writes the given Java String to the CLOB value that this SerialClob object represents, at the position pos.
Parameters:
  pos - the position at which to start writing to the CLOBvalue that this SerialClob object represents; the first position is 1; must not be less than 1 norgreater than the length of this SerialClob object
Parameters:
  str - the string to be written to the CLOBvalue that this SerialClob object represents the number of characters written
throws:
  SerialException - if there is an error accessing the CLOB value; if an invalid position is set; if an invalid offset value is set; if number of bytes to be writtenis greater than the SerialClob length; or the combinedvalues of the length and offset is greater than the Clob buffer



setString
public int setString(long pos, String str, int offset, int length) throws SerialException(Code)
Writes len characters of str, starting at character offset, to the CLOB value that this Clob represents.
Parameters:
  pos - the position at which to start writing to the CLOBvalue that this SerialClob object represents; the first position is 1; must not be less than 1 norgreater than the length of this SerialClob object
Parameters:
  str - the string to be written to the CLOB value that this Clob object represents
Parameters:
  offset - the offset into str to start readingthe characters to be written
Parameters:
  length - the number of characters to be written the number of characters written
throws:
  SerialException - if there is an error accessing the CLOB value; if an invalid position is set; if an invalid offset value is set; if number of bytes to be writtenis greater than the SerialClob length; or the combinedvalues of the length and offset is greater than the Clob buffer



truncate
public void truncate(long length) throws SerialException(Code)
Truncates the CLOB value that this SerialClob object represents so that it has a length of len characters.

Truncating a SerialClob object to length 0 has the effect of clearing its contents.
Parameters:
  length - the length, in bytes, to which the CLOBvalue should be truncated
throws:
  SQLException - if there is an error accessing the CLOB value




Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.