Package org.postgresql.largeobject

Examples of org.postgresql.largeobject.LargeObjectManager


            int oid = res.getInt(1);
            if (oid != -1) {
                conn.setAutoCommit(false);
                PGConnection pgconn = (PGConnection)conn
                    .getInnermostDelegate();
                LargeObjectManager lom = pgconn.getLargeObjectAPI();
                if (ob != null) {
                    LargeObject lo = lom.open(oid, LargeObjectManager.WRITE);
                    OutputStream os = lo.getOutputStream();
                    copy((InputStream)ob, os);
                    lo.close();
                } else {
                    lom.delete(oid);
                    row.setInt(col, -1);
                }
            } else {
                if (ob != null) {
                    conn.setAutoCommit(false);
                    PGConnection pgconn = (PGConnection)conn
                        .getInnermostDelegate();
                    LargeObjectManager lom = pgconn.getLargeObjectAPI();
                    oid = lom.create();
                    LargeObject lo = lom.open(oid, LargeObjectManager.WRITE);
                    OutputStream os = lo.getOutputStream();
                    copy((InputStream)ob, os);
                    lo.close();
                    row.setInt(col, oid);
                }
View Full Code Here


            int oid = res.getInt(1);
            if (oid != -1) {
                conn.setAutoCommit(false);
                PGConnection pgconn = (PGConnection)conn
                    .getInnermostDelegate();
                LargeObjectManager lom = pgconn.getLargeObjectAPI();
                lom.delete(oid);
            }
        } finally {
            if (res != null)
                try { res.close (); } catch (SQLException e) {}
            if (stmnt != null)
View Full Code Here

     * @exception SQLException by LargeObject when initialising for first time
     */
    public LargeObjectManager getLargeObjectAPI() throws SQLException
    {
        if (largeobject == null)
            largeobject = new LargeObjectManager(this);
        return largeobject;
    }
View Full Code Here

    private ArrayList subLOs;

    public AbstractJdbc2BlobClob(BaseConnection conn, long oid) throws SQLException
    {
        this.conn = conn;
        LargeObjectManager lom = conn.getLargeObjectAPI();
        this.lo = lom.open(oid);
        subLOs = new ArrayList();
    }
View Full Code Here

     */
    public LargeObjectManager getLargeObjectAPI() throws SQLException
    {
        checkClosed();
        if (largeobject == null)
            largeobject = new LargeObjectManager(this);
        return largeobject;
    }
View Full Code Here

TOP

Related Classes of org.postgresql.largeobject.LargeObjectManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.