パッケージ org.postgresql.core

インタフェース TypeInfo

既知の実装クラスのリスト:
TypeInfoCache

public interface TypeInfo
  • メソッドの詳細

    • addCoreType

      void addCoreType(String pgTypeName, Integer oid, Integer sqlType, String javaClass, Integer arrayOid)
    • addDataType

      void addDataType(String type, Class<? extends PGobject> klass) throws SQLException
      例外:
      SQLException
    • getSQLType

      int getSQLType(int oid) throws SQLException
      Look up the SQL typecode for a given type oid.
      パラメータ:
      oid - the type's OID
      戻り値:
      the SQL type code (a constant from Types) for the type
      例外:
      SQLException - if an error occurs when retrieving sql type
    • getSQLType

      int getSQLType(String pgTypeName) throws SQLException
      Look up the SQL typecode for a given postgresql type name.
      パラメータ:
      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

      int getJavaArrayType(String className) throws SQLException
      例外:
      SQLException
    • getPGType

      int getPGType(String pgTypeName) throws SQLException
      Look up the oid for a given postgresql type name. This is the inverse of getPGType(int).
      パラメータ:
      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

      @Nullable String getPGType(int oid) throws SQLException
      Look up the postgresql type name for a given oid. This is the inverse of getPGType(String).
      パラメータ:
      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
    • getPGArrayElement

      int getPGArrayElement(int oid) throws SQLException
      Look up the oid of an array's base type given the array's type oid.
      パラメータ:
      oid - the array type's OID
      戻り値:
      the base type's OID, or 0 if unknown
      例外:
      SQLException - if an error occurs when retrieving array element
    • getPGArrayType

      int getPGArrayType(String elementTypeName) throws SQLException
      Determine the oid of the given base postgresql type's array type.
      パラメータ:
      elementTypeName - the base type's
      戻り値:
      the array type's OID, or 0 if unknown
      例外:
      SQLException - if an error occurs when retrieving array type
    • getArrayDelimiter

      char getArrayDelimiter(int oid) throws SQLException
      Determine the delimiter for the elements of the given array type oid.
      パラメータ:
      oid - the array type's OID
      戻り値:
      the base type's array type delimiter
      例外:
      SQLException - if an error occurs when retrieving array delimiter
    • getPGTypeNamesWithSQLTypes

      Iterator<String> getPGTypeNamesWithSQLTypes()
    • getPGTypeOidsWithSQLTypes

      Iterator<Integer> getPGTypeOidsWithSQLTypes()
    • getPGobject

      @Nullable Class<? extends PGobject> getPGobject(String type)
    • getJavaClass

      String getJavaClass(int oid) throws SQLException
      例外:
      SQLException
    • getTypeForAlias

      @Nullable String getTypeForAlias(String alias)
    • getPrecision

      int getPrecision(int oid, int typmod)
    • getScale

      int getScale(int oid, int typmod)
    • isCaseSensitive

      boolean isCaseSensitive(int oid)
    • isSigned

      boolean isSigned(int oid)
    • getDisplaySize

      int getDisplaySize(int oid, int typmod)
    • getMaximumPrecision

      int getMaximumPrecision(int oid)
    • requiresQuoting

      boolean requiresQuoting(int oid) throws SQLException
      例外:
      SQLException
    • requiresQuotingSqlType

      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.
      パラメータ:
      sqlType - sql type as in java.sql.Types
      戻り値:
      true if the type requires quoting
      例外:
      SQLException - if something goes wrong
    • longOidToInt

      int longOidToInt(long oid) throws SQLException

      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.

      パラメータ:
      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

      long intOidToLong(int oid)
      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.
      パラメータ:
      oid - the (signed) integer oid to convert into a long.
      戻り値:
      the non-negative value of this oid, stored as a java long.