public synchronized OutputStream setBinaryStream(long pos) throws SQLException { assertPosition(pos); LargeObject subLO = lo.copy(); subLOs.add(subLO); subLO.seek((int)(pos-1)); return subLO.getOutputStream(); }
long oid = lom.createLO(); LargeObject lob = lom.open(oid); OutputStream outputStream = lob.getOutputStream(); byte[] buf = new byte[4096]; try {
long oid = lom.createLO(); LargeObject lob = lom.open(oid); OutputStream los = lob.getOutputStream(); byte[] buf = new byte[4096]; try
LargeObject lob = lom.open(oid); Charset connectionCharset = Charset.forName(connection.getEncoding().name()); OutputStream los = lob.getOutputStream(); Writer lw = new OutputStreamWriter(los, connectionCharset); try {
public synchronized OutputStream setBinaryStream(long pos) throws SQLException { assertPosition(pos); LargeObject subLO = getLo(true).copy(); addSubLO(subLO); subLO.seek((int) (pos - 1)); return subLO.getOutputStream(); }
long oid = lom.createLO(); LargeObject lob = lom.open(oid); OutputStream los = lob.getOutputStream(); try
long oid = lom.createLO(); LargeObject lob = lom.open(oid); OutputStream los = lob.getOutputStream(); try
long oid = lom.createLO(); LargeObject lob = lom.open(oid); OutputStream los = lob.getOutputStream(); try
public synchronized OutputStream setBinaryStream(long pos) throws SQLException { assertPosition(pos); LargeObject subLO = lo.copy(); subLOs.add(subLO); subLO.seek((int)(pos-1)); return subLO.getOutputStream(); }
public synchronized OutputStream setBinaryStream(long pos) throws SQLException { assertPosition(pos); LargeObject subLO = lo.copy(); subLOs.add(subLO); subLO.seek((int)(pos-1)); return subLO.getOutputStream(); }
long oid = lom.createLO(); LargeObject lob = lom.open(oid); OutputStream los = lob.getOutputStream(); try
private void doWritePostgres(Handle h, String path, InputStream file) { doDelete(h, path); try { LargeObjectManager lobj = getPostgresConnection(h.getConnection()).getLargeObjectAPI(); long oid = lobj.createLO(); LargeObject obj = lobj.open(oid, LargeObjectManager.WRITE); try (OutputStream lob = obj.getOutputStream()) { IOUtils.copy(file, lob); } h.insert("INSERT INTO filestore(path, data) values (?,?)", path, oid); } catch (IOException | SQLException ex) { throw DaoException.launderThrowable(ex); } }
private void doWritePostgres(Handle h, String path, InputStream file) { doDelete(h, path); try { LargeObjectManager lobj = getPostgresConnection(h.getConnection()).getLargeObjectAPI(); long oid = lobj.createLO(); LargeObject obj = lobj.open(oid, LargeObjectManager.WRITE); try (OutputStream lob = obj.getOutputStream()) { IOUtils.copy(file, lob); } h.insert("INSERT INTO filestore(path, data) values (?,?)", path, oid); } catch (IOException | SQLException ex) { throw ExtensionDataAccessException.launderThrowable(ex); } }
private void doWritePostgres(Handle h, String path, InputStream file) { doDelete(h, path); try { LargeObjectManager lobj = getPostgresConnection(h.getConnection()).getLargeObjectAPI(); long oid = lobj.createLO(); LargeObject obj = lobj.open(oid, LargeObjectManager.WRITE); try (OutputStream lob = obj.getOutputStream()) { IOUtils.copy(file, lob); } h.insert("INSERT INTO filestore(path, data) values (?,?)", path, oid); } catch (IOException | SQLException ex) { throw DaoException.launderThrowable(ex); } }
private void doWritePostgres(Handle h, String id, InputStream file) { doDelete(h, id); try { LargeObjectManager lobj = getPostgresConnection(h.getConnection()).getLargeObjectAPI(); long oid = lobj.createLO(); LargeObject obj = lobj.open(oid, LargeObjectManager.WRITE); try (OutputStream lob = obj.getOutputStream()) { IOUtils.copy(file, lob); } h.insert("INSERT INTO icon_filestore(id, data) values (?,?)", id, oid); } catch (IOException | SQLException ex) { throw IconDataAccessException.launderThrowable(ex); } }
private void insertPostgresBlob(Row row, Column col, JDBCStore store, Object ob) throws SQLException { if (ob != null) { col.setType(Types.INTEGER); DelegatingConnection conn = (DelegatingConnection)store .getConnection(); try { conn.setAutoCommit(false); LargeObjectManager lom = getLargeObjectManager(conn); // The create method is valid in versions previous to 8.3 // in 8.3 this method is deprecated, use createLO int oid = lom.create(); LargeObject lo = lom.open(oid, LargeObjectManager.WRITE); OutputStream os = lo.getOutputStream(); copy((InputStream)ob, os); lo.close(); row.setInt(col, oid); } catch (IOException ioe) { throw new StoreException(ioe); } finally { conn.close(); } } else { row.setInt(col, -1); } }
private void insertPostgresBlob(Row row, Column col, JDBCStore store, Object ob) throws SQLException { if (ob != null) { col.setType(Types.INTEGER); DelegatingConnection conn = (DelegatingConnection)store .getConnection(); try { conn.setAutoCommit(false); LargeObjectManager lom = getLargeObjectManager(conn); // The create method is valid in versions previous to 8.3 // in 8.3 this method is deprecated, use createLO int oid = lom.create(); LargeObject lo = lom.open(oid, LargeObjectManager.WRITE); OutputStream os = lo.getOutputStream(); copy((InputStream)ob, os); lo.close(); row.setInt(col, oid); } catch (IOException ioe) { throw new StoreException(ioe); } finally { conn.close(); } } else { row.setInt(col, -1); } }
private void insertPostgresBlob(Row row, Column col, JDBCStore store, Object ob) throws SQLException { if (ob != null) { col.setType(Types.INTEGER); DelegatingConnection conn = (DelegatingConnection)store .getConnection(); try { conn.setAutoCommit(false); LargeObjectManager lom = getLargeObjectManager(conn); // The create method is valid in versions previous to 8.3 // in 8.3 this method is deprecated, use createLO int oid = lom.create(); LargeObject lo = lom.open(oid, LargeObjectManager.WRITE); OutputStream os = lo.getOutputStream(); copy((InputStream)ob, os); lo.close(); row.setInt(col, oid); } catch (IOException ioe) { throw new StoreException(ioe); } finally { conn.close(); } } else { row.setInt(col, -1); } }
private void insertPostgresBlob(Row row, Column col, JDBCStore store, Object ob) throws SQLException { if (ob != null) { col.setType(Types.INTEGER); DelegatingConnection conn = (DelegatingConnection)store .getConnection(); try { conn.setAutoCommit(false); LargeObjectManager lom = getLargeObjectManager(conn); // The create method is valid in versions previous to 8.3 // in 8.3 this method is deprecated, use createLO int oid = lom.create(); LargeObject lo = lom.open(oid, LargeObjectManager.WRITE); OutputStream os = lo.getOutputStream(); copy((InputStream)ob, os); lo.close(); row.setInt(col, oid); } catch (IOException ioe) { throw new StoreException(ioe); } finally { conn.close(); } } else { row.setInt(col, -1); } }
private void insertPostgresBlob(Row row, Column col, JDBCStore store, Object ob) throws SQLException { if (ob != null) { col.setType(Types.INTEGER); DelegatingConnection conn = (DelegatingConnection)store .getConnection(); try { conn.setAutoCommit(false); PGConnection pgconn = (PGConnection) conn.getInnermostDelegate(); LargeObjectManager lom = pgconn.getLargeObjectAPI(); // The create method is valid in versions previous 8.3 // in 8.3 this methos is deprecated, use createLO int oid = lom.create(); LargeObject lo = lom.open(oid, LargeObjectManager.WRITE); OutputStream os = lo.getOutputStream(); copy((InputStream)ob, os); lo.close(); row.setInt(col, oid); } catch (IOException ioe) { throw new StoreException(ioe); } finally { conn.close(); } } else { row.setInt(col, -1); } }