/** * Returns the OID of a field. It is used internally by the driver. * * @param field field index * @return OID of a field */ public int getColumnOID(int field) { return fields[field - 1].getOID(); }
/** * Returns true if the specified field should be retrieved using binary encoding. * * @param field The field whose Oid type to analyse. * @return True if {@link Field#BINARY_FORMAT} should be used, false if * {@link Field#BINARY_FORMAT}. */ private boolean useBinary(Field field) { int oid = field.getOID(); return useBinaryForReceive(oid); }
protected String getPGType( int column ) throws SQLException { return connection.getTypeInfo().getPGType(fields[column - 1].getOID()); }
public Array createArray(int i) throws SQLException { checkResultSet(i); int oid = fields[i - 1].getOID(); String value = getFixedString(i); return new Jdbc4Array(connection, oid, value); }
/** * {@inheritDoc} * * <p>Is the column a signed number? In PostgreSQL, all numbers are signed, so this is trivial. * However, strings are not signed (duh!) * * @param column the first column is 1, the second is 2... * @return true if so * @exception SQLException if a database access error occurs */ public boolean isSigned(int column) throws SQLException { Field field = getField(column); return connection.getTypeInfo().isSigned(field.getOID()); }
protected String getPGType(int columnIndex) throws SQLException { return connection.getTypeInfo().getPGType(getField(columnIndex).getOID()); }
protected int getSQLType(int columnIndex) throws SQLException { return connection.getTypeInfo().getSQLType(getField(columnIndex).getOID()); }
public boolean isSigned(int column) throws SQLException { Field field = getField(column); return connection.getTypeInfo().isSigned(field.getOID()); }
/** * {@inheritDoc} * * <p>Does a column's case matter? ASSUMPTION: Any field that is not obviously case insensitive is * assumed to be case sensitive * * @param column the first column is 1, the second is 2... * @return true if so * @exception SQLException if a database access error occurs */ public boolean isCaseSensitive(int column) throws SQLException { Field field = getField(column); return connection.getTypeInfo().isCaseSensitive(field.getOID()); }
public boolean isCaseSensitive(int column) throws SQLException { Field field = getField(column); return connection.getTypeInfo().isCaseSensitive(field.getOID()); }
protected int getSQLType(int columnIndex) throws SQLException { return connection.getTypeInfo().getSQLType(getField(columnIndex).getOID()); }
public int getScale(int column) throws SQLException { Field field = getField(column); return connection.getTypeInfo().getScale(field.getOID(), field.getMod()); }
public int getScale(int column) throws SQLException { Field field = getField(column); return connection.getTypeInfo().getScale(field.getOID(), field.getMod()); }
public int getColumnDisplaySize(int column) throws SQLException { Field field = getField(column); return connection.getTypeInfo().getDisplaySize(field.getOID(), field.getMod()); }
public int getPrecision(int column) throws SQLException { Field field = getField(column); return connection.getTypeInfo().getPrecision(field.getOID(), field.getMod()); }
public int getColumnDisplaySize(int column) throws SQLException { Field field = getField(column); return connection.getTypeInfo().getDisplaySize(field.getOID(), field.getMod()); }
public int getPrecision(int column) throws SQLException { Field field = getField(column); return connection.getTypeInfo().getPrecision(field.getOID(), field.getMod()); }
public java.sql.Array getArray(int i) throws SQLException { checkResultSet(i); if (wasNullFlag) { return null; } int oid = fields[i - 1].getOID(); if (isBinary(i)) { return makeArray(oid, this_row[i - 1]); } return makeArray(oid, getFixedString(i)); }
public synchronized void updateNull(int columnIndex) throws SQLException { checkColumnIndex(columnIndex); String columnTypeName = connection.getTypeInfo().getPGType(fields[columnIndex - 1].getOID()); updateValue(columnIndex, new NullObject(columnTypeName)); }
private void initSqlType(Field field) throws SQLException { if (field.isTypeInitialized()) { return; } TypeInfo typeInfo = connection.getTypeInfo(); int oid = field.getOID(); String pgType = typeInfo.getPGType(oid); int sqlType = typeInfo.getSQLType(pgType); field.setSQLType(sqlType); field.setPGType(pgType); }