public void setBinaryStream(int parameterIndex, InputStream value) throws SQLException { preparedParameters.setBytea(parameterIndex, value); }
void populateParameter(ParameterList params, int index) throws SQLException { if (bytes == null) params.setNull(index, 0); else params.setBytea(index, bytes, bytesStart, bytesLength); } }
void populateParameter(ParameterList params, int index) throws SQLException { if (bytes == null) { params.setNull(index, 0); } else { params.setBytea(index, bytes, bytesStart, bytesLength); } } }
public void setBytes(int parameterIndex, byte[] x) throws SQLException { checkClosed(); if (null == x) { setNull(parameterIndex, Types.VARBINARY); return; } // Version 7.2 supports the bytea datatype for byte arrays byte[] copy = new byte[x.length]; System.arraycopy(x, 0, copy, 0, x.length); preparedParameters.setBytea(parameterIndex, copy, 0, x.length); }
public void setBinaryStream(int parameterIndex, InputStream value, long length) throws SQLException { if (length > Integer.MAX_VALUE) { throw new PSQLException(GT.tr("Object is too large to send over the protocol."), PSQLState.NUMERIC_CONSTANT_OUT_OF_RANGE); } preparedParameters.setBytea(parameterIndex, value, (int) length); }
public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException { checkClosed(); if (x == null) { setNull(parameterIndex, Types.VARBINARY); return; } if (length < 0) { throw new PSQLException(GT.tr("Invalid stream length {0}.", length), PSQLState.INVALID_PARAMETER_VALUE); } // Version 7.2 supports BinaryStream for for the PG bytea type // As the spec/javadoc for this method indicate this is to be used for // large binary values (i.e. LONGVARBINARY) PG doesn't have a separate // long binary datatype, but with toast the bytea datatype is capable of // handling very large values. preparedParameters.setBytea(parameterIndex, x, length); }
preparedParameters.setBytea(parameterIndex, x, length);
public void setBytes(int parameterIndex, byte[] x) throws SQLException { checkClosed(); if (null == x) { setNull(parameterIndex, Types.VARBINARY); return ; } if (connection.haveMinimumCompatibleVersion("7.2")) { //Version 7.2 supports the bytea datatype for byte arrays byte[] copy = new byte[x.length]; System.arraycopy(x, 0, copy, 0, x.length); preparedParameters.setBytea( parameterIndex, copy, 0, x.length); } else { //Version 7.1 and earlier support done as LargeObjects LargeObjectManager lom = connection.getLargeObjectAPI(); long oid = lom.createLO(); LargeObject lob = lom.open(oid); lob.write(x); lob.close(); setLong(parameterIndex, oid); } }
void populateParameter(ParameterList params, int index) throws SQLException { if (bytes == null) params.setNull(index, 0); else params.setBytea(index, bytes, bytesStart, bytesLength); } }
void populateParameter(ParameterList params, int index) throws SQLException { if (bytes == null) params.setNull(index, 0); else params.setBytea(index, bytes, bytesStart, bytesLength); } }
preparedParameters.setBytea(parameterIndex, x, length);
preparedParameters.setBytea(parameterIndex, x, length);
public void setBytes(int parameterIndex, byte[] x) throws SQLException { checkClosed(); if (null == x) { setNull(parameterIndex, Types.VARBINARY); return ; } if (connection.haveMinimumCompatibleVersion("7.2")) { //Version 7.2 supports the bytea datatype for byte arrays byte[] copy = new byte[x.length]; System.arraycopy(x, 0, copy, 0, x.length); preparedParameters.setBytea( parameterIndex, copy, 0, x.length); } else { //Version 7.1 and earlier support done as LargeObjects LargeObjectManager lom = connection.getLargeObjectAPI(); long oid = lom.createLO(); LargeObject lob = lom.open(oid); lob.write(x); lob.close(); setLong(parameterIndex, oid); } }
public void setBytes(int parameterIndex, byte[] x) throws SQLException { checkClosed(); if (null == x) { setNull(parameterIndex, Types.VARBINARY); return ; } if (connection.haveMinimumCompatibleVersion("7.2")) { //Version 7.2 supports the bytea datatype for byte arrays byte[] copy = new byte[x.length]; System.arraycopy(x, 0, copy, 0, x.length); preparedParameters.setBytea( parameterIndex, copy, 0, x.length); } else { //Version 7.1 and earlier support done as LargeObjects LargeObjectManager lom = connection.getLargeObjectAPI(); long oid = lom.createLO(); LargeObject lob = lom.open(oid); lob.write(x); lob.close(); setLong(parameterIndex, oid); } }