public void setNull(int parameterIndex, int sqlType) throws SQLException { if (sqlType == Types.BOOLEAN) { sqlType = Types.BIT; } super.setNull(parameterIndex, sqlType); }
public void setNull(int i, int t, String s) throws SQLException { checkClosed(); setNull(i, t); }
public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException { checkClosed(); if (x == null) setNull(parameterIndex, Types.DECIMAL); else bindLiteral(parameterIndex, x.toString(), Oid.NUMERIC); }
public void setTime(int i, Time t, java.util.Calendar cal) throws SQLException { checkClosed(); if (t == null) { setNull(i, Types.TIME); return; } if (cal != null) cal = (Calendar)cal.clone(); bindString(i, connection.getTimestampUtils().toString(cal, t), Oid.UNSPECIFIED); }
setNull(i, Types.BLOB); return;
setNull(parameterIndex, Types.VARCHAR); return ;
public void setDate(int i, java.sql.Date d, java.util.Calendar cal) throws SQLException { checkClosed(); if (d == null) { setNull(i, Types.DATE); return; } if (cal != null) cal = (Calendar)cal.clone(); // We must use UNSPECIFIED here, or inserting a Date-with-timezone into a // timestamptz field does an unexpected rotation by the server's TimeZone: // // We want to interpret 2005/01/01 with calendar +0100 as // "local midnight in +0100", but if we go via date it interprets it // as local midnight in the server's timezone: // template1=# select '2005-01-01+0100'::timestamptz; // timestamptz // ------------------------ // 2005-01-01 02:00:00+03 // (1 row) // template1=# select '2005-01-01+0100'::date::timestamptz; // timestamptz // ------------------------ // 2005-01-01 00:00:00+03 // (1 row) bindString(i, connection.getTimestampUtils().toString(cal, d), Oid.UNSPECIFIED); }
setNull(i, Types.TIMESTAMP); return;
setNull(i, Types.CLOB); return;
public void setArray(int i, java.sql.Array x) throws SQLException { checkClosed(); if (null == x) { setNull(i, Types.ARRAY); return; } // This only works for Array implementations that return a valid array // literal from Array.toString(), such as the implementation we return // from ResultSet.getArray(). Eventually we need a proper implementation // here that works for any Array implementation. // Use a typename that is "_" plus the base type; this matches how the // backend looks for array types. String typename = "_" + x.getBaseTypeName(); int oid = connection.getTypeInfo().getPGType(typename); if (oid == Oid.UNSPECIFIED) throw new PSQLException(GT.tr("Unknown type {0}.", typename), PSQLState.INVALID_PARAMETER_TYPE); setString(i, x.toString(), oid); }
setNull(parameterIndex, Types.VARBINARY); return ;
setNull(parameterIndex, targetSqlType); return ;
setNull(parameterIndex, Types.OTHER); else if (x instanceof String) setString(parameterIndex, (String)x);
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 setNull(int parameterIndex, int sqlType) throws SQLException { if (sqlType == Types.BOOLEAN) { sqlType = Types.BIT; } super.setNull(parameterIndex, sqlType); }
public void setNull(int parameterIndex, int sqlType) throws SQLException { if (sqlType == Types.BOOLEAN) { sqlType = Types.BIT; } super.setNull(parameterIndex, sqlType); }
public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException { checkClosed(); if (x == null) setNull(parameterIndex, Types.DECIMAL); else bindLiteral(parameterIndex, x.toString(), Oid.NUMERIC); }
public void setTime(int i, Time t, java.util.Calendar cal) throws SQLException { checkClosed(); if (t == null) { setNull(i, Types.TIME); return; } if (cal != null) cal = (Calendar)cal.clone(); bindString(i, connection.getTimestampUtils().toString(cal, t), Oid.UNSPECIFIED); }
public void setTime(int i, Time t, java.util.Calendar cal) throws SQLException { checkClosed(); if (t == null) { setNull(i, Types.TIME); return; } if (cal != null) cal = (Calendar)cal.clone(); bindString(i, connection.getTimestampUtils().toString(cal, t), Oid.UNSPECIFIED); }