/** * This convenience method assumes that the return value is an oid. * @param name Function name * @param args Function arguments * @exception SQLException if a database-access error occurs or no result */ public long getOID(String name, FastpathArg[] args) throws SQLException { long oid = getInteger(name, args); if (oid < 0) oid += NUM_OIDS; return oid; }
/** * This convenience method assumes that the return value is an oid. * * @param name Function name * @param args Function arguments * @return oid of the given call * @throws SQLException if a database-access error occurs or no result */ public long getOID(String name, FastpathArg[] args) throws SQLException { long oid = getInteger(name, args); if (oid < 0) { oid += NUM_OIDS; } return oid; }
/** * @return the current position within the object * @throws SQLException if a database-access error occurs. */ public int tell() throws SQLException { FastpathArg[] args = new FastpathArg[1]; args[0] = new FastpathArg(fd); return fp.getInteger("lo_tell", args); }
/** * @return the current position within the object * @exception SQLException if a database-access error occurs. */ public int tell() throws SQLException { FastpathArg args[] = new FastpathArg[1]; args[0] = new FastpathArg(fd); return fp.getInteger("lo_tell", args); }
/** * 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. * * @param len given length in bytes * @throws SQLException if something goes wrong */ public void truncate64(long len) throws SQLException { FastpathArg[] args = new FastpathArg[2]; args[0] = new FastpathArg(fd); args[1] = new FastpathArg(len); fp.getInteger("lo_truncate64", args); }
/** * 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. * * @param len given length in bytes * @throws SQLException if something goes wrong */ public void truncate(int len) throws SQLException { FastpathArg[] args = new FastpathArg[2]; args[0] = new FastpathArg(fd); args[1] = new FastpathArg(len); fp.getInteger("lo_truncate", args); }
/** * 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. */ public void truncate(int len) throws SQLException { FastpathArg args[] = new FastpathArg[2]; args[0] = new FastpathArg(fd); args[1] = new FastpathArg(len); fp.getInteger("lo_truncate", args); }
/** * This opens a large object. * * <p>If the object does not exist, then an SQLException is thrown. * * @param fp FastPath API for the connection to use * @param oid of the Large Object to open * @param mode Mode of opening the large object * (defined in LargeObjectManager) * @exception SQLException if a database-access error occurs. * @see org.postgresql.largeobject.LargeObjectManager */ protected LargeObject(Fastpath fp, long oid, int mode) throws SQLException { this.fp = fp; this.oid = oid; this.mode = mode; FastpathArg args[] = new FastpathArg[2]; args[0] = Fastpath.createOIDArg(oid); args[1] = new FastpathArg(mode); this.fd = fp.getInteger("lo_open", args); }
/** * <p>This opens a large object.</p> * * <p>If the object does not exist, then an SQLException is thrown.</p> * * @param fp FastPath API for the connection to use * @param oid of the Large Object to open * @param mode Mode of opening the large object * @param conn the connection to the database used to access this LOB * @param commitOnClose commit the transaction when this LOB will be closed (defined in * LargeObjectManager) * @throws SQLException if a database-access error occurs. * @see org.postgresql.largeobject.LargeObjectManager */ protected LargeObject(Fastpath fp, long oid, int mode, BaseConnection conn, boolean commitOnClose) throws SQLException { this.fp = fp; this.oid = oid; this.mode = mode; if (commitOnClose) { this.commitOnClose = true; this.conn = conn; } else { this.commitOnClose = false; } FastpathArg[] args = new FastpathArg[2]; args[0] = Fastpath.createOIDArg(oid); args[1] = new FastpathArg(mode); this.fd = fp.getInteger("lo_open", args); }
/** * This convenience method assumes that the return value is an oid. * @param name Function name * @param args Function arguments * @exception SQLException if a database-access error occurs or no result */ public long getOID(String name, FastpathArg[] args) throws SQLException { long oid = getInteger(name, args); if (oid < 0) oid += NUM_OIDS; return oid; }
/** * This convenience method assumes that the return value is an oid. * @param name Function name * @param args Function arguments * @exception SQLException if a database-access error occurs or no result */ public long getOID(String name, FastpathArg[] args) throws SQLException { long oid = getInteger(name, args); if (oid < 0) oid += NUM_OIDS; return oid; }
/** * @return the current position within the object * @exception SQLException if a database-access error occurs. */ public int tell() throws SQLException { FastpathArg args[] = new FastpathArg[1]; args[0] = new FastpathArg(fd); return fp.getInteger("lo_tell", args); }
/** * @return the current position within the object * @exception SQLException if a database-access error occurs. */ public int tell() throws SQLException { FastpathArg args[] = new FastpathArg[1]; args[0] = new FastpathArg(fd); return fp.getInteger("lo_tell", args); }
/** * 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. */ public void truncate(int len) throws SQLException { FastpathArg args[] = new FastpathArg[2]; args[0] = new FastpathArg(fd); args[1] = new FastpathArg(len); fp.getInteger("lo_truncate", args); }
/** * 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. */ public void truncate(int len) throws SQLException { FastpathArg args[] = new FastpathArg[2]; args[0] = new FastpathArg(fd); args[1] = new FastpathArg(len); fp.getInteger("lo_truncate", args); }
/** * This opens a large object. * * <p>If the object does not exist, then an SQLException is thrown. * * @param fp FastPath API for the connection to use * @param oid of the Large Object to open * @param mode Mode of opening the large object * (defined in LargeObjectManager) * @exception SQLException if a database-access error occurs. * @see org.postgresql.largeobject.LargeObjectManager */ protected LargeObject(Fastpath fp, long oid, int mode) throws SQLException { this.fp = fp; this.oid = oid; this.mode = mode; FastpathArg args[] = new FastpathArg[2]; args[0] = Fastpath.createOIDArg(oid); args[1] = new FastpathArg(mode); this.fd = fp.getInteger("lo_open", args); }
/** * This opens a large object. * * <p>If the object does not exist, then an SQLException is thrown. * * @param fp FastPath API for the connection to use * @param oid of the Large Object to open * @param mode Mode of opening the large object * (defined in LargeObjectManager) * @exception SQLException if a database-access error occurs. * @see org.postgresql.largeobject.LargeObjectManager */ protected LargeObject(Fastpath fp, long oid, int mode) throws SQLException { this.fp = fp; this.oid = oid; this.mode = mode; FastpathArg args[] = new FastpathArg[2]; args[0] = Fastpath.createOIDArg(oid); args[1] = new FastpathArg(mode); this.fd = fp.getInteger("lo_open", args); }