Codota Logo
Field
Code IndexAdd Codota to your IDE (free)

How to use
Field
in
org.postgresql.core

Best Java code snippets using org.postgresql.core.Field (Showing top 20 results out of 315)

  • Common ways to obtain Field
private void myMethod () {
Field f =
  • Codota IconString str;new Field(str, oid)
  • Codota IconString str;String columnName;new Field(str, columnName, oid, length, mod, int1, int2)
  • Smart code suggestions by Codota
}
origin: org.postgresql/postgresql

@Override
public ResultSet getTableTypes() throws SQLException {
 String[] types = tableTypeClauses.keySet().toArray(new String[0]);
 Arrays.sort(types);
 Field[] f = new Field[1];
 List<byte[][]> v = new ArrayList<byte[][]>();
 f[0] = new Field("TABLE_TYPE", Oid.VARCHAR);
 for (String type : types) {
  byte[][] tuple = new byte[1][];
  tuple[0] = connection.encodeString(type);
  v.add(tuple);
 }
 return ((BaseStatement) createMetaDataStatement()).createDriverResultSet(f, v);
}
origin: org.postgresql/postgresql

public static Map<String, Integer> createColumnNameIndexMap(Field[] fields,
  boolean isSanitiserDisabled) {
 Map<String, Integer> columnNameIndexMap = new HashMap<String, Integer>(fields.length * 2);
 // The JDBC spec says when you have duplicate columns names,
 // the first one should be returned. So load the map in
 // reverse order so the first ones will overwrite later ones.
 for (int i = fields.length - 1; i >= 0; i--) {
  String columnLabel = fields[i].getColumnLabel();
  if (isSanitiserDisabled) {
   columnNameIndexMap.put(columnLabel, i + 1);
  } else {
   columnNameIndexMap.put(columnLabel.toLowerCase(Locale.US), i + 1);
  }
 }
 return columnNameIndexMap;
}
origin: org.postgresql/postgresql

/**
 * Returns true if the value of the given column is in binary format.
 *
 * @param column The column to check. Range starts from 1.
 * @return True if the column is in binary format.
 */
protected boolean isBinary(int column) {
 return fields[column - 1].getFormat() == Field.BINARY_FORMAT;
}
origin: org.postgresql/postgresql

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);
}
origin: org.postgresql/postgresql

private boolean populateFieldsWithMetadata(Gettable<FieldMetadata.Key, FieldMetadata> metadata) {
 boolean allOk = true;
 for (Field field : fields) {
  if (field.getMetadata() != null) {
   // No need to update metadata
   continue;
  }
  final FieldMetadata fieldMetadata =
    metadata.get(new FieldMetadata.Key(field.getTableOid(), field.getPositionInTable()));
  if (fieldMetadata == null) {
   allOk = false;
  } else {
   field.setMetadata(fieldMetadata);
  }
 }
 fieldInfoFetched |= allOk;
 return allOk;
}
origin: org.postgresql/postgresql

public String getBaseColumnName(int column) throws SQLException {
 Field field = getField(column);
 if (field.getTableOid() == 0) {
  return "";
 }
 fetchFieldMetaData();
 return field.getMetadata().columnName;
}
origin: org.postgresql/postgresql

public int getScale(int column) throws SQLException {
 Field field = getField(column);
 return connection.getTypeInfo().getScale(field.getOID(), field.getMod());
}
origin: postgresql/postgresql

if (fields[i].getTableOid() == 0)
  continue;
sql.append(fields[i].getTableOid());
if (!hasSourceInfo)
  sql.append(" AS oid ");
sql.append(", ");
sql.append(fields[i].getPositionInTable());
if (!hasSourceInfo)
  sql.append(" AS attnum");
boolean autoIncrement = rs.getBoolean(7);
for (int i=0; i<fields.length; i++) {
  if (fields[i].getTableOid() == table && fields[i].getPositionInTable() == column) {
    fields[i].setColumnName(columnName);
    fields[i].setTableName(tableName);
    fields[i].setSchemaName(schemaName);
    fields[i].setNullable(nullable);
    fields[i].setAutoIncrement(autoIncrement);
origin: org.postgresql/postgresql

fields[0] = new Field("INDEX", Oid.INT4);
fields[0].setFormat(Field.BINARY_FORMAT);
fields[1] = new Field("VALUE", elementOid);
fields[1].setFormat(Field.BINARY_FORMAT);
for (int i = 1; i < index; ++i) {
 int len = ByteConverter.int4(fieldBytes, pos);
fields[0] = new Field("INDEX", Oid.INT4);
fields[0].setFormat(Field.BINARY_FORMAT);
fields[1] = new Field("VALUE", elementOid);
fields[1].setFormat(Field.BINARY_FORMAT);
for (int i = 1; i < index; ++i) {
 int len = ByteConverter.int4(fieldBytes, pos);
fields[0] = new Field("INDEX", Oid.INT4);
fields[0].setFormat(Field.BINARY_FORMAT);
fields[1] = new Field("VALUE", oid);
fields[1].setFormat(Field.BINARY_FORMAT);
int nextDimension = thisDimension + 1;
int dimensionsLeft = dims.length - nextDimension;
origin: org.postgresql/postgresql

/**
 * 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();
}
origin: postgresql/postgresql

  return null;
if (fields[columnIndex - 1].getFormat() == Field.BINARY_FORMAT)
  if (fields[columnIndex - 1].getOID() == Oid.BYTEA)
  if ( fields[columnIndex - 1].getOID() == Oid.OID)
origin: org.postgresql/postgresql

if (field.getMetadata() != null) {
 continue;
sql.append(field.getTableOid());
if (!hasSourceInfo) {
 sql.append(" AS oid ");
sql.append(field.getPositionInTable());
if (!hasSourceInfo) {
 sql.append(" AS attnum");
origin: org.postgresql/postgresql

for (Field field : fields) {
 if (useBinary(field)) {
  field.setFormat(Field.BINARY_FORMAT);
  query.setHasBinaryFields(true);
 if (field.getFormat() != Field.TEXT_FORMAT) {
  field.setFormat(Field.TEXT_FORMAT);
pgStream.sendInteger2(fields[i].getFormat());
origin: postgresql/postgresql

case Types.DECIMAL:
  return getBigDecimal
      (columnIndex, (field.getMod() == -1) ? -1 : ((field.getMod() - 4) & 0xffff));
case Types.REAL:
  return new Float(getFloat(columnIndex));
origin: postgresql/postgresql

  fields[i].setFormat(Field.BINARY_FORMAT); //Set the field to binary format
if (maxRows == 0 || tuples.size() < maxRows)
  tuples.addElement(tuple);
origin: postgresql/postgresql

public String getBaseColumnName(int column) throws SQLException {
  fetchFieldMetaData();
  Field field = getField(column);
  return field.getColumnName();
}
origin: org.ancoron.postgresql/org.postgresql.osgi

public String getBaseTableName(int column) throws SQLException
  if (field.getTableOid() == 0)
  Integer tableOid = new Integer(field.getTableOid());
  if (tableNameCache == null)
origin: postgresql/postgresql

public int isNullable(int column) throws SQLException
{
  fetchFieldMetaData();
  Field field = getField(column);
  return field.getNullable();
}
origin: postgresql/postgresql

public boolean isAutoIncrement(int column) throws SQLException
{
  fetchFieldMetaData();
  Field field = getField(column);
  return field.getAutoIncrement();
}
origin: postgresql/postgresql

public int getScale(int column) throws SQLException
{
  Field field = getField(column);
  return connection.getTypeInfo().getScale(field.getOID(), field.getMod());
}
org.postgresql.coreField

Most used methods

  • <init>
  • getColumnLabel
  • getFormat
  • getMod
  • getOID
  • getTableOid
  • setFormat
  • getAutoIncrement
  • getColumnName
  • getNullable
  • getPositionInTable
  • getSchemaName
  • getPositionInTable,
  • getSchemaName,
  • getTableName,
  • setAutoIncrement,
  • setColumnName,
  • setNullable,
  • setSchemaName,
  • setTableName,
  • getLength,
  • getMetadata

Popular in Java

  • Start an intent from android
  • addToBackStack (FragmentTransaction)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • TreeMap (java.util)
    A Red-Black tree based NavigableMap implementation. The map is sorted according to the Comparable of
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now