Save This Page
Home » struts-2.0.11.2-src » example » [javadoc | source]
example
public class: blobtest [javadoc | source]
java.lang.Object
   example.blobtest
This test attempts to create a blob in the database, then to read it back. Important note: You will notice we import the org.postgresql.largeobject package, but don't import the org.postgresql package. The reason for this is that importing postgresql can confuse javac (we have conflicting class names in org.postgresql.* and java.sql.*). This doesn't cause any problems, as long as no code imports org.postgresql. Under normal circumstances, code using any jdbc driver only needs to import java.sql, so this isn't a problem. It's only if you use the non jdbc facilities, do you have to take this into account.
Field Summary
 Connection db     
 Statement s     
 LargeObjectManager lobj     
Constructor:
 public blobtest(String[] args) throws IOException, ClassNotFoundException, SQLException, FileNotFoundException 
Method from example.blobtest Summary:
instructions,   jdbc2api,   main,   ownapi
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from example.blobtest Detail:
 public static  void instructions() 
 public  void jdbc2api(int oid) throws IOException, SQLException 
 public static  void main(String[] args) 
 public  void ownapi() throws IOException, SQLException, FileNotFoundException 
    Now this is an extension to JDBC, unique to postgresql. Here we fetch an PGlobj object, which provides us with access to postgresql's large object api.