Java Doc for LargeObject.java in  » Database-JDBC-Connection-Pool » postgresql » org » postgresql » largeobject » 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 JDBC Connection Pool » postgresql » org.postgresql.largeobject 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.postgresql.largeobject.LargeObject

LargeObject
public class LargeObject (Code)
This class provides the basic methods required to run the interface, plus a pair of methods that provide InputStream and OutputStream classes for this object.

Normally, client code would use the getAsciiStream, getBinaryStream, or getUnicodeStream methods in ResultSet, or setAsciiStream, setBinaryStream, or setUnicodeStream methods in PreparedStatement to access Large Objects.

However, sometimes lower level access to Large Objects are required, that are not supported by the JDBC specification.

Refer to org.postgresql.largeobject.LargeObjectManager on how to gain access to a Large Object, or how to create one.
See Also:   org.postgresql.largeobject.LargeObjectManager
See Also:   java.sql.ResultSet.getAsciiStream
See Also:   java.sql.ResultSet.getBinaryStream
See Also:   java.sql.ResultSet.getUnicodeStream
See Also:   java.sql.PreparedStatement.setAsciiStream
See Also:   java.sql.PreparedStatement.setBinaryStream
See Also:   java.sql.PreparedStatement.setUnicodeStream



Field Summary
final public static  intSEEK_CUR
    
final public static  intSEEK_END
    
final public static  intSEEK_SET
    

Constructor Summary
protected  LargeObject(Fastpath fp, long oid, int mode)
     This opens a large object.

Method Summary
public  voidclose()
     This method closes the object.
public  LargeObjectcopy()
    
public  InputStreamgetInputStream()
     Returns an InputStream from this object.
public  longgetLongOID()
    
public  intgetOID()
    
public  OutputStreamgetOutputStream()
     Returns an OutputStream to this object.
public  byte[]read(int len)
    
public  intread(byte buf, int off, int len)
    
public  voidseek(int pos, int ref)
     Sets the current position within the object.

This is similar to the fseek() call in the standard C library.

public  voidseek(int pos)
     Sets the current position within the object.

This is similar to the fseek() call in the standard C library.

public  intsize()
     This method is inefficient, as the only way to find out the size of the object is to seek to the end, record the current position, then return to the original position.
public  inttell()
    
public  voidtruncate(int len)
     Truncates the large object to the given length in bytes. If the number of bytes is larger than the current large object length, the large object will be filled with zero bytes.
public  voidwrite(byte buf)
    
public  voidwrite(byte buf, int off, int len)
    

Field Detail
SEEK_CUR
final public static int SEEK_CUR(Code)
Indicates a seek from the current position



SEEK_END
final public static int SEEK_END(Code)
Indicates a seek from the end of a file



SEEK_SET
final public static int SEEK_SET(Code)
Indicates a seek from the begining of a file




Constructor Detail
LargeObject
protected LargeObject(Fastpath fp, long oid, int mode) throws SQLException(Code)
This opens a large object.

If the object does not exist, then an SQLException is thrown.
Parameters:
  fp - FastPath API for the connection to use
Parameters:
  oid - of the Large Object to open
Parameters:
  mode - Mode of opening the large object(defined in LargeObjectManager)
exception:
  SQLException - if a database-access error occurs.
See Also:   org.postgresql.largeobject.LargeObjectManager





Method Detail
close
public void close() throws SQLException(Code)
This method closes the object. You must not call methods in this object after this is called.
exception:
  SQLException - if a database-access error occurs.



copy
public LargeObject copy() throws SQLException(Code)



getInputStream
public InputStream getInputStream() throws SQLException(Code)
Returns an InputStream from this object.

This InputStream can then be used in any method that requires an InputStream.
exception:
  SQLException - if a database-access error occurs.




getLongOID
public long getLongOID()(Code)
the OID of this LargeObject



getOID
public int getOID()(Code)
the OID of this LargeObjectLargeObject.getLongOID()



getOutputStream
public OutputStream getOutputStream() throws SQLException(Code)
Returns an OutputStream to this object.

This OutputStream can then be used in any method that requires an OutputStream.
exception:
  SQLException - if a database-access error occurs.




read
public byte[] read(int len) throws SQLException(Code)
Reads some data from the object, and return as a byte[] array
Parameters:
  len - number of bytes to read byte[] array containing data read
exception:
  SQLException - if a database-access error occurs.



read
public int read(byte buf, int off, int len) throws SQLException(Code)
Reads some data from the object into an existing array
Parameters:
  buf - destination array
Parameters:
  off - offset within array
Parameters:
  len - number of bytes to read the number of bytes actually read
exception:
  SQLException - if a database-access error occurs.



seek
public void seek(int pos, int ref) throws SQLException(Code)
Sets the current position within the object.

This is similar to the fseek() call in the standard C library. It allows you to have random access to the large object.
Parameters:
  pos - position within object
Parameters:
  ref - Either SEEK_SET, SEEK_CUR or SEEK_END
exception:
  SQLException - if a database-access error occurs.




seek
public void seek(int pos) throws SQLException(Code)
Sets the current position within the object.

This is similar to the fseek() call in the standard C library. It allows you to have random access to the large object.
Parameters:
  pos - position within object from begining
exception:
  SQLException - if a database-access error occurs.




size
public int size() throws SQLException(Code)
This method is inefficient, as the only way to find out the size of the object is to seek to the end, record the current position, then return to the original position.

A better method will be found in the future. the size of the large object
exception:
  SQLException - if a database-access error occurs.




tell
public int tell() throws SQLException(Code)
the current position within the object
exception:
  SQLException - if a database-access error occurs.



truncate
public void truncate(int len) throws SQLException(Code)
Truncates the large object to the given length in bytes. If the number of bytes is larger than the current large object length, the large object will be filled with zero bytes. This method does not modify the current file offset.



write
public void write(byte buf) throws SQLException(Code)
Writes an array to the object
Parameters:
  buf - array to write
exception:
  SQLException - if a database-access error occurs.



write
public void write(byte buf, int off, int len) throws SQLException(Code)
Writes some data from an array to the object
Parameters:
  buf - destination array
Parameters:
  off - offset within array
Parameters:
  len - number of bytes to write
exception:
  SQLException - if a database-access error occurs.



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.