Java Doc for EmbedClob.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » impl » jdbc » Java Source Code / Java DocumentationJava Source Code and Java Documentation

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 geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database DBMS » db derby 10.2 » org.apache.derby.impl.jdbc 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.derby.impl.jdbc.ConnectionChild
      org.apache.derby.impl.jdbc.EmbedClob

EmbedClob
final class EmbedClob extends ConnectionChild implements Clob(Code)
Implements java.sql.Clob (see the JDBC 2.0 spec). A clob sits on top of a CHAR, VARCHAR or LONG VARCHAR column. If its data is small (less than 1 page) it is a byte array taken from the SQLChar class. If it is large (more than 1 page) it is a long column in the database. The long column is accessed as a stream, and is implemented in store as an OverflowInputStream. The Resetable interface allows sending messages to that stream to initialize itself (reopen its container and lock the corresponding row) and to reset itself to the beginning. NOTE: In the case that the data is large, it is represented as a stream. This stream can be returned to the user in the getAsciiStream() method. This means that we have limited control over the state of the stream, since the user can read bytes from it at any time. Thus all methods here reset the stream to the beginning before doing any work. CAVEAT: The methods may not behave correctly if a user sets up multiple threads and sucks data from the stream (returned from getAsciiStream()) at the same time as calling the Clob methods.

Supports

  • JSR169 - no subsetting for java.sql.Clob
  • JDBC 2.0
  • JDBC 3.0 - no new dependencies on new JDBC 3.0 or JDK 1.4 classes, new update methods can safely be added into implementation.



Constructor Summary
 EmbedClob(String clobString, EmbedConnection con)
     This constructor is used to create a empty Clob object.
protected  EmbedClob(DataValueDescriptor dvd, EmbedConnection con)
    

Method Summary
protected  voidfinalize()
    
public  voidfree()
     This method frees the Clob object and releases the resources the resources that it holds.
public  java.io.InputStreamgetAsciiStream()
     Gets the CLOB value designated by this Clob object as a stream of Ascii bytes.
public  java.io.ReadergetCharacterStream()
     Gets the Clob contents as a Unicode stream.
public  java.io.ReadergetCharacterStream(long pos, long length)
    
public  StringgetSubString(long pos, int length)
     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.
public  longlength()
     Returns the number of characters in the CLOB value designated by this Clob object.
static  SQLExceptionnoStateChangeLOB(Throwable t)
    
public  longposition(String searchStr, long start)
     Determines the character position at which the specified substring searchstr appears in the CLOB.
public  longposition(Clob searchClob, long start)
     Determines the character position at which the specified Clob object searchstr appears in this Clob object.
public  java.io.OutputStreamsetAsciiStream(long pos)
     JDBC 3.0 Retrieves a stream to be used to write Ascii characters to the CLOB value that this Clob object represents, starting at position pos.
public  java.io.WritersetCharacterStream(long pos)
     JDBC 3.0 Retrieves a stream to be used to write a stream of Unicode characters to the CLOB value that this Clob object represents, starting at position pos.
public  intsetString(long pos, String parameterName)
     JDBC 3.0 Writes the given Java String to the CLOB value that this Clob object designates at the position pos.
public  intsetString(long pos, String str, int offset, int len)
     JDBC 3.0 Writes len characters of str, starting at character offset, to the CLOB value that this Clob represents.
public  voidtruncate(long len)
    


Constructor Detail
EmbedClob
EmbedClob(String clobString, EmbedConnection con)(Code)
This constructor is used to create a empty Clob object. It is used by the Connection interface method createClob().
Parameters:
  clobString - A String object containing the data to be stores in the Clob.
Parameters:
  con - The Connection object associated with this EmbedClob object.



EmbedClob
protected EmbedClob(DataValueDescriptor dvd, EmbedConnection con) throws StandardException(Code)




Method Detail
finalize
protected void finalize()(Code)



free
public void free() throws SQLException(Code)
This method frees the Clob object and releases the resources the resources that it holds. The object is invalid once the free method is called. If free is called multiple times, the subsequent calls to free are treated as a no-op.
throws:
  SQLException - if an error occurs releasingthe Clob's resources



getAsciiStream
public java.io.InputStream getAsciiStream() throws SQLException(Code)
Gets the CLOB value designated by this Clob object as a stream of Ascii bytes. an ascii stream containing the CLOB data
exception:
  SQLException - if there is an error accessing theCLOB value



getCharacterStream
public java.io.Reader getCharacterStream() throws SQLException(Code)
Gets the Clob contents as a Unicode stream. a Unicode stream containing the CLOB data
exception:
  SQLException - if there is an error accessing theCLOB



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



getSubString
public String getSubString(long pos, int length) throws SQLException(Code)
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. The starting position must be between 1 and the length of the CLOB plus 1. This allows for zero-length CLOB values, from which only zero-length substrings can be returned. If a larger length is requested than there are characters available, characters from the start position to the end of the CLOB are returned.
Parameters:
  pos - the first character of the substring to be extracted.The first character is at position 1.
Parameters:
  length - the number of consecutive characters to be copied a String that is the specified substring inthe CLOB value designated by this Clob object
exception:
  SQLException - if there is an error accessing theCLOBNOTE: If the starting position is the length of the CLOB plus 1,zero characters are returned regardless of the length requested.



length
public long length() throws SQLException(Code)
Returns the number of characters in the CLOB value designated by this Clob object. length of the CLOB in characters
exception:
  SQLException - if there is an error accessing thelength of the CLOB



noStateChangeLOB
static SQLException noStateChangeLOB(Throwable t)(Code)



position
public long position(String searchStr, long start) throws SQLException(Code)
Determines the character position at which the specified substring searchstr appears in the CLOB. The search begins at position start.
Parameters:
  searchStr - the substring for which to search
Parameters:
  start - the position at which to begin searching; the first positionis 1 the position at which the substring appears, else -1; the firstposition is 1
exception:
  SQLException - if there is an error accessing theCLOB value



position
public long position(Clob searchClob, long start) throws SQLException(Code)
Determines the character position at which the specified Clob object searchstr appears in this Clob object. The search begins at position start.
Parameters:
  searchClob - the Clob object for which to search
Parameters:
  start - the position at which to begin searching; the firstposition is 1 the position at which the Clob object appears,else -1; the first position is 1
exception:
  SQLException - if there is an error accessing theCLOB value



setAsciiStream
public java.io.OutputStream setAsciiStream(long pos) throws SQLException(Code)
JDBC 3.0 Retrieves a stream to be used to write Ascii characters to the CLOB value that this Clob object represents, starting at position pos.
Parameters:
  pos - - the position at which to start writing to this Clob object the stream to which ASCII encoded characters can be written
exception:
  SQLException - Feature not implemented for now.



setCharacterStream
public java.io.Writer setCharacterStream(long pos) throws SQLException(Code)
JDBC 3.0 Retrieves a stream to be used to write a stream of Unicode characters to the CLOB value that this Clob object represents, starting at position pos.
Parameters:
  pos - - the position at which to start writing to this Clob object the stream to which Unicode encoded characters can be written
exception:
  SQLException - Feature not implemented for now.



setString
public int setString(long pos, String parameterName) throws SQLException(Code)
JDBC 3.0 Writes the given Java String to the CLOB value that this Clob object designates at the position pos.
Parameters:
  pos - - the position at which to start writing to the CLOB value thatthis Clob object represents the number of characters written
exception:
  SQLException - Feature not implemented for now.



setString
public int setString(long pos, String str, int offset, int len) throws SQLException(Code)
JDBC 3.0 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 this Clob object
Parameters:
  str - - the string to be written to the CLOB value that this Clob designates
Parameters:
  offset - - the offset into str to start reading the characters to be written
Parameters:
  len - - the number of characters to be written the number of characters written
exception:
  SQLException - Feature not implemented for now.



truncate
public void truncate(long len) throws SQLException(Code)
JDBC 3.0 Truncates the CLOB value that this Clob designates to have a length of len characters
Parameters:
  len - - the length, in bytes, to which the CLOB value that this Blobvalue should be truncated
exception:
  SQLException - Feature not implemented for now.



Fields inherited from org.apache.derby.impl.jdbc.ConnectionChild
final InternalDriver factory(Code)(Java Doc)
EmbedConnection localConn(Code)(Java Doc)

Methods inherited from org.apache.derby.impl.jdbc.ConnectionChild
final void commitIfAutoCommit() throws SQLException(Code)(Java Doc)
final void commitIfNeeded() throws SQLException(Code)(Java Doc)
java.util.Calendar getCal()(Code)(Java Doc)
final Object getConnectionSynchronization()(Code)(Java Doc)
final EmbedConnection getEmbedConnection()(Code)(Java Doc)
final SQLException handleException(Throwable t) throws SQLException(Code)(Java Doc)
final void needCommit()(Code)(Java Doc)
SQLException newSQLException(String messageId)(Code)(Java Doc)
SQLException newSQLException(String messageId, Object arg1)(Code)(Java Doc)
SQLException newSQLException(String messageId, Object arg1, Object arg2)(Code)(Java Doc)
final void restoreContextStack() throws SQLException(Code)(Java Doc)
final void setupContextStack() throws SQLException(Code)(Java Doc)

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.