パッケージ org.postgresql.jdbc
クラス TypeInfoCache
java.lang.Object
org.postgresql.jdbc.TypeInfoCache
- すべての実装されたインタフェース:
TypeInfo
-
コンストラクタの概要
コンストラクタ -
メソッドの概要
修飾子とタイプメソッド説明void
void
addDataType
(String type, Class<? extends PGobject> klass) void
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.char
getArrayDelimiter
(int oid) Determine the delimiter for the elements of the given array type oid.int
getDisplaySize
(int oid, int typmod) int
getJavaArrayType
(String className) getJavaClass
(int oid) int
getMaximumPrecision
(int oid) int
getPGArrayElement
(int oid) Look up the oid of an array's base type given the array's type oid.int
getPGArrayType
(@Nullable String elementTypeName) Determine the oid of the given base postgresql type's array type.getPGobject
(String type) @Nullable String
getPGType
(int oid) Look up the postgresql type name for a given oid.int
Look up the oid for a given postgresql type name.int
getPrecision
(int oid, int typmod) int
getScale
(int oid, int typmod) int
getSQLType
(int typeOid) Look up the SQL typecode for a given type oid.int
getSQLType
(String pgTypeName) Look up the SQL typecode for a given postgresql type name.@Nullable String
getTypeForAlias
(@Nullable String alias) long
intOidToLong
(int oid) Java Integers are signed 32-bit integers, but oids are unsigned 32-bit integers.boolean
isCaseSensitive
(int oid) boolean
isSigned
(int oid) int
longOidToInt
(long oid) Java Integers are signed 32-bit integers, but oids are unsigned 32-bit integers.boolean
requiresQuoting
(int oid) boolean
requiresQuotingSqlType
(int sqlType) Returns true if particular sqlType requires quoting.
-
コンストラクタの詳細
-
TypeInfoCache
-
-
メソッドの詳細
-
addCoreType
public void addCoreType(String pgTypeName, Integer oid, Integer sqlType, String javaClass, Integer arrayOid) - 定義:
addCoreType
インタフェース内TypeInfo
-
addDataType
- 定義:
addDataType
インタフェース内TypeInfo
- 例外:
SQLException
-
getPGTypeNamesWithSQLTypes
- 定義:
getPGTypeNamesWithSQLTypes
インタフェース内TypeInfo
-
getPGTypeOidsWithSQLTypes
- 定義:
getPGTypeOidsWithSQLTypes
インタフェース内TypeInfo
-
cacheSQLTypes
- 例外:
SQLException
-
getSQLType
インタフェースからコピーされた説明: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
- 定義:
getJavaArrayType
インタフェース内TypeInfo
- 例外:
SQLException
-
getSQLType
インタフェースからコピーされた説明: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
インタフェースからコピーされた説明:TypeInfo
Look up the oid for a given postgresql type name. This is the inverse ofTypeInfo.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
インタフェースからコピーされた説明:TypeInfo
Look up the postgresql type name for a given oid. This is the inverse ofTypeInfo.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
インタフェースからコピーされた説明: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
インタフェースからコピーされた説明: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
インタフェースからコピーされた説明: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
- 定義:
getPGobject
インタフェース内TypeInfo
-
getJavaClass
- 定義:
getJavaClass
インタフェース内TypeInfo
- 例外:
SQLException
-
getTypeForAlias
- 定義:
getTypeForAlias
インタフェース内TypeInfo
-
getPrecision
public int getPrecision(int oid, int typmod) - 定義:
getPrecision
インタフェース内TypeInfo
-
getScale
public int getScale(int oid, int typmod) -
isCaseSensitive
public boolean isCaseSensitive(int oid) - 定義:
isCaseSensitive
インタフェース内TypeInfo
-
isSigned
public boolean isSigned(int oid) -
getDisplaySize
public int getDisplaySize(int oid, int typmod) - 定義:
getDisplaySize
インタフェース内TypeInfo
-
getMaximumPrecision
public int getMaximumPrecision(int oid) - 定義:
getMaximumPrecision
インタフェース内TypeInfo
-
requiresQuoting
- 定義:
requiresQuoting
インタフェース内TypeInfo
- 例外:
SQLException
-
requiresQuotingSqlType
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
インタフェースからコピーされた説明: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.
-