Package org.postgresql.core
Interface TypeInfo
- All Known Implementing Classes:
TypeInfoCache
public interface TypeInfo
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addDataType
(String type, Class<? extends PGobject> klass) char
getArrayDelimiter
(int oid) Determine the delimiter for the elements of the given array type oid.int
getDisplaySize
(int oid, int typmod) 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
(String elementTypeName) Determine the oid of the given base postgresql type's array type.getPGobject
(String type) 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 oid) 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.getTypeForAlias
(String alias) boolean
isCaseSensitive
(int oid) boolean
isSigned
(int oid) boolean
requiresQuoting
(int oid) boolean
requiresQuotingSqlType
(int sqlType) Returns true if particular sqlType requires quoting.
-
Method Details
-
addCoreType
-
addDataType
- Throws:
SQLException
-
getSQLType
Look up the SQL typecode for a given type oid.- Parameters:
oid
- the type's OID- Returns:
- the SQL type code (a constant from
Types
) for the type - Throws:
SQLException
- if an error occurs when retrieving sql type
-
getSQLType
Look up the SQL typecode for a given postgresql type name.- Parameters:
pgTypeName
- the server type name to look up- Returns:
- the SQL type code (a constant from
Types
) for the type - Throws:
SQLException
- if an error occurs when retrieving sql type
-
getPGType
Look up the oid for a given postgresql type name. This is the inverse ofgetPGType(int)
.- Parameters:
pgTypeName
- the server type name to look up- Returns:
- the type's OID, or 0 if unknown
- Throws:
SQLException
- if an error occurs when retrieving PG type
-
getPGType
Look up the postgresql type name for a given oid. This is the inverse ofgetPGType(String)
.- Parameters:
oid
- the type's OID- Returns:
- the server type name for that OID or null if unknown
- Throws:
SQLException
- if an error occurs when retrieving PG type
-
getPGArrayElement
Look up the oid of an array's base type given the array's type oid.- Parameters:
oid
- the array type's OID- Returns:
- the base type's OID, or 0 if unknown
- Throws:
SQLException
- if an error occurs when retrieving array element
-
getPGArrayType
Determine the oid of the given base postgresql type's array type.- Parameters:
elementTypeName
- the base type's- Returns:
- the array type's OID, or 0 if unknown
- Throws:
SQLException
- if an error occurs when retrieving array type
-
getArrayDelimiter
Determine the delimiter for the elements of the given array type oid.- Parameters:
oid
- the array type's OID- Returns:
- the base type's array type delimiter
- Throws:
SQLException
- if an error occurs when retrieving array delimiter
-
getPGTypeNamesWithSQLTypes
-
getPGobject
-
getJavaClass
- Throws:
SQLException
-
getTypeForAlias
-
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
- Throws:
SQLException
-
requiresQuotingSqlType
Returns true if particular sqlType requires quoting. This method is used internally by the driver, so it might disappear without notice.- Parameters:
sqlType
- sql type as in java.sql.Types- Returns:
- true if the type requires quoting
- Throws:
SQLException
- if something goes wrong
-