パッケージ org.postgresql.jdbc

クラス TypeInfoCache

java.lang.Object
org.postgresql.jdbc.TypeInfoCache
すべての実装されたインタフェース:
TypeInfo

public class TypeInfoCache extends Object implements TypeInfo
  • コンストラクタの詳細

    • TypeInfoCache

      public TypeInfoCache(BaseConnection conn, int unknownLength)
  • メソッドの詳細

    • addCoreType

      public void addCoreType(String pgTypeName, Integer oid, Integer sqlType, String javaClass, Integer arrayOid)
      定義:
      addCoreType インタフェース内 TypeInfo
    • addDataType

      public void addDataType(String type, Class<? extends PGobject> klass) throws SQLException
      定義:
      addDataType インタフェース内 TypeInfo
      例外:
      SQLException
    • getPGTypeNamesWithSQLTypes

      public Iterator<String> getPGTypeNamesWithSQLTypes()
      定義:
      getPGTypeNamesWithSQLTypes インタフェース内 TypeInfo
    • getPGTypeOidsWithSQLTypes

      public Iterator<Integer> getPGTypeOidsWithSQLTypes()
      定義:
      getPGTypeOidsWithSQLTypes インタフェース内 TypeInfo
    • cacheSQLTypes

      public void cacheSQLTypes() throws SQLException
      例外:
      SQLException
    • getSQLType

      public int getSQLType(String pgTypeName) throws SQLException
      インタフェースからコピーされた説明: TypeInfo
      Look up the SQL typecode for a given postgresql type name.
      定義:
      getSQLType インタフェース内 TypeInfo
      パラメータ:
      pgTypeName - the server type name to look up
      戻り値:
      the SQL type code (a constant from Types) for the type
      例外:
      SQLException - if an error occurs when retrieving sql type
    • getJavaArrayType

      public int getJavaArrayType(String className) throws SQLException
      定義:
      getJavaArrayType インタフェース内 TypeInfo
      例外:
      SQLException
    • getSQLType

      public int getSQLType(int typeOid) throws SQLException
      インタフェースからコピーされた説明: TypeInfo
      Look up the SQL typecode for a given type oid.
      定義:
      getSQLType インタフェース内 TypeInfo
      パラメータ:
      typeOid - the type's OID
      戻り値:
      the SQL type code (a constant from Types) for the type
      例外:
      SQLException - if an error occurs when retrieving sql type
    • getPGType

      public int getPGType(String pgTypeName) throws SQLException
      インタフェースからコピーされた説明: TypeInfo
      Look up the oid for a given postgresql type name. This is the inverse of TypeInfo.getPGType(int).
      定義:
      getPGType インタフェース内 TypeInfo
      パラメータ:
      pgTypeName - the server type name to look up
      戻り値:
      the type's OID, or 0 if unknown
      例外:
      SQLException - if an error occurs when retrieving PG type
    • getPGType

      public @Nullable String getPGType(int oid) throws SQLException
      インタフェースからコピーされた説明: TypeInfo
      Look up the postgresql type name for a given oid. This is the inverse of TypeInfo.getPGType(String).
      定義:
      getPGType インタフェース内 TypeInfo
      パラメータ:
      oid - the type's OID
      戻り値:
      the server type name for that OID or null if unknown
      例外:
      SQLException - if an error occurs when retrieving PG type
    • getPGArrayType

      public int getPGArrayType(@Nullable String elementTypeName) throws SQLException
      インタフェースからコピーされた説明: TypeInfo
      Determine the oid of the given base postgresql type's array type.
      定義:
      getPGArrayType インタフェース内 TypeInfo
      パラメータ:
      elementTypeName - the base type's
      戻り値:
      the array type's OID, or 0 if unknown
      例外:
      SQLException - if an error occurs when retrieving array type
    • convertArrayToBaseOid

      protected int convertArrayToBaseOid(int oid)
      Return the oid of the array's base element if it's an array, if not return the provided oid. This doesn't do any database lookups, so it's only useful for the originally provided type mappings. This is fine for it's intended uses where we only have intimate knowledge of types that are already known to the driver.
      パラメータ:
      oid - input oid
      戻り値:
      oid of the array's base element or the provided oid (if not array)
    • getArrayDelimiter

      public char getArrayDelimiter(int oid) throws SQLException
      インタフェースからコピーされた説明: TypeInfo
      Determine the delimiter for the elements of the given array type oid.
      定義:
      getArrayDelimiter インタフェース内 TypeInfo
      パラメータ:
      oid - the array type's OID
      戻り値:
      the base type's array type delimiter
      例外:
      SQLException - if an error occurs when retrieving array delimiter
    • getPGArrayElement

      public int getPGArrayElement(int oid) throws SQLException
      インタフェースからコピーされた説明: TypeInfo
      Look up the oid of an array's base type given the array's type oid.
      定義:
      getPGArrayElement インタフェース内 TypeInfo
      パラメータ:
      oid - the array type's OID
      戻り値:
      the base type's OID, or 0 if unknown
      例外:
      SQLException - if an error occurs when retrieving array element
    • getPGobject

      public @Nullable Class<? extends PGobject> getPGobject(String type)
      定義:
      getPGobject インタフェース内 TypeInfo
    • getJavaClass

      public String getJavaClass(int oid) throws SQLException
      定義:
      getJavaClass インタフェース内 TypeInfo
      例外:
      SQLException
    • getTypeForAlias

      public @Nullable String getTypeForAlias(@Nullable String alias)
      定義:
      getTypeForAlias インタフェース内 TypeInfo
    • getPrecision

      public int getPrecision(int oid, int typmod)
      定義:
      getPrecision インタフェース内 TypeInfo
    • getScale

      public int getScale(int oid, int typmod)
      定義:
      getScale インタフェース内 TypeInfo
    • isCaseSensitive

      public boolean isCaseSensitive(int oid)
      定義:
      isCaseSensitive インタフェース内 TypeInfo
    • isSigned

      public boolean isSigned(int oid)
      定義:
      isSigned インタフェース内 TypeInfo
    • getDisplaySize

      public int getDisplaySize(int oid, int typmod)
      定義:
      getDisplaySize インタフェース内 TypeInfo
    • getMaximumPrecision

      public int getMaximumPrecision(int oid)
      定義:
      getMaximumPrecision インタフェース内 TypeInfo
    • requiresQuoting

      public boolean requiresQuoting(int oid) throws SQLException
      定義:
      requiresQuoting インタフェース内 TypeInfo
      例外:
      SQLException
    • requiresQuotingSqlType

      public boolean requiresQuotingSqlType(int sqlType) throws SQLException
      Returns true if particular sqlType requires quoting. This method is used internally by the driver, so it might disappear without notice.
      定義:
      requiresQuotingSqlType インタフェース内 TypeInfo
      パラメータ:
      sqlType - sql type as in java.sql.Types
      戻り値:
      true if the type requires quoting
      例外:
      SQLException - if something goes wrong
    • longOidToInt

      public int longOidToInt(long oid) throws SQLException
      インタフェースからコピーされた説明: TypeInfo

      Java Integers are signed 32-bit integers, but oids are unsigned 32-bit integers. We therefore read them as positive long values and then force them into signed integers (wrapping around into negative values when required) or we'd be unable to correctly handle the upper half of the oid space.

      This function handles the mapping of uint32-values in the long to java integers, and throws for values that are out of range.

      定義:
      longOidToInt インタフェース内 TypeInfo
      パラメータ:
      oid - the oid as a long.
      戻り値:
      the (internal) signed integer representation of the (unsigned) oid.
      例外:
      SQLException - if the long has a value outside of the range representable by uint32
    • intOidToLong

      public long intOidToLong(int oid)
      インタフェースからコピーされた説明: TypeInfo
      Java Integers are signed 32-bit integers, but oids are unsigned 32-bit integers. We must therefore first map the (internal) integer representation to a positive long value before sending it to postgresql, or we would be unable to correctly handle the upper half of the oid space because these negative values are disallowed as OID values.
      定義:
      intOidToLong インタフェース内 TypeInfo
      パラメータ:
      oid - the (signed) integer oid to convert into a long.
      戻り値:
      the non-negative value of this oid, stored as a java long.