diff options
author | Bruce Momjian <bruce@momjian.us> | 1999-01-17 04:51:59 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 1999-01-17 04:51:59 +0000 |
commit | 298682d9e0b0ec55d5f72cec1f4d43c23f2a1ac6 (patch) | |
tree | 57f9d4552366b3f9fe9552aafe47505ff61b14ac /src/interfaces/jdbc/postgresql/largeobject/LargeObject.java | |
parent | 4a6285ee445efc13f0e726be1629762ff366e602 (diff) |
As the email posted to the announce and interfaces list, attached is a tar
file containing the latest version of the JDBC driver, allowing it to be
compiled and used under JDK 1.2 and later.
NB: None (well almost none) of the new methods actually do anything. This
release only handles getting it to compile and run. Now this is done, I'll
start working on implementing the new stuff.
Now this tar file replaces everything under src/interfaces/jdbc. I had to
do it this way, rather than diffs, because most of the classes under the
postgresql subdirectory have moved to a new directory under that one, to
enable the support of the two JDBC standards.
Here's a list of files in the tar file. Any file not listed here (in the
postgresql directory) will have to be deleted, otherwise it could cause
the driver to fail:
Peter Mount
Diffstat (limited to 'src/interfaces/jdbc/postgresql/largeobject/LargeObject.java')
-rw-r--r-- | src/interfaces/jdbc/postgresql/largeobject/LargeObject.java | 42 |
1 files changed, 34 insertions, 8 deletions
diff --git a/src/interfaces/jdbc/postgresql/largeobject/LargeObject.java b/src/interfaces/jdbc/postgresql/largeobject/LargeObject.java index 0cab20f8e33..e2d394bf051 100644 --- a/src/interfaces/jdbc/postgresql/largeobject/LargeObject.java +++ b/src/interfaces/jdbc/postgresql/largeobject/LargeObject.java @@ -112,14 +112,40 @@ public class LargeObject * @return byte[] array containing data read * @exception SQLException if a database-access error occurs. */ - public byte[] read(int len) throws SQLException - { - FastpathArg args[] = new FastpathArg[2]; - args[0] = new FastpathArg(fd); - args[1] = new FastpathArg(len); - return fp.getData("loread",args); - } - + public byte[] read(int len) throws SQLException + { + // This is the original method, where the entire block (len bytes) + // is retrieved in one go. + FastpathArg args[] = new FastpathArg[2]; + args[0] = new FastpathArg(fd); + args[1] = new FastpathArg(len); + return fp.getData("loread",args); + + // This version allows us to break this down into 4k blocks + //if(len<=4048) { + //// handle as before, return the whole block in one go + //FastpathArg args[] = new FastpathArg[2]; + //args[0] = new FastpathArg(fd); + //args[1] = new FastpathArg(len); + //return fp.getData("loread",args); + //} else { + //// return in 4k blocks + //byte[] buf=new byte[len]; + //int off=0; + //while(len>0) { + //int bs=4048; + //len-=bs; + //if(len<0) { + //bs+=len; + //len=0; + //} + //read(buf,off,bs); + //off+=bs; + //} + //return buf; + //} + } + /** * Reads some data from the object into an existing array * |