| Modifier and Type | Field and Description |
|---|---|
private java.util.Map<java.lang.Integer,java.lang.Character> |
_arrayOidToDelimiter |
private BaseConnection |
_conn |
private java.sql.PreparedStatement |
_getArrayDelimiterStatement |
private java.sql.PreparedStatement |
_getArrayElementOidStatement |
private java.sql.PreparedStatement |
_getNameStatement |
private java.sql.PreparedStatement |
_getOidStatementComplexArray |
private java.sql.PreparedStatement |
_getOidStatementComplexNonArray |
private java.sql.PreparedStatement |
_getOidStatementSimple |
private java.sql.PreparedStatement |
_getTypeInfoStatement |
private java.util.Map<java.lang.Integer,java.lang.String> |
_oidToPgName |
private java.util.Map<java.lang.Integer,java.lang.Integer> |
_pgArrayToPgType |
private java.util.Map<java.lang.String,java.lang.String> |
_pgNameToJavaClass |
private java.util.Map<java.lang.String,java.lang.Integer> |
_pgNameToOid |
private java.util.Map<java.lang.String,java.lang.Class<? extends PGobject>> |
_pgNameToPgObject |
private java.util.Map<java.lang.String,java.lang.Integer> |
_pgNameToSQLType |
private int |
_unknownLength |
private static java.util.HashMap<java.lang.String,java.lang.String> |
typeAliases
PG maps several alias to real type names.
|
private static java.lang.Object[][] |
types |
| Constructor and Description |
|---|
TypeInfoCache(BaseConnection conn,
int unknownLength) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCoreType(java.lang.String pgTypeName,
java.lang.Integer oid,
java.lang.Integer sqlType,
java.lang.String javaClass,
java.lang.Integer arrayOid) |
void |
addDataType(java.lang.String type,
java.lang.Class<? extends PGobject> klass) |
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) |
java.lang.String |
getJavaClass(int oid) |
int |
getMaximumPrecision(int oid) |
private java.sql.PreparedStatement |
getOidStatement(java.lang.String pgTypeName) |
int |
getPGArrayElement(int oid)
Look up the oid of an array's base type given the array's type oid.
|
int |
getPGArrayType(java.lang.String elementTypeName)
Determine the oid of the given base postgresql type's array type.
|
java.lang.Class<? extends PGobject> |
getPGobject(java.lang.String type) |
java.lang.String |
getPGType(int oid)
Look up the postgresql type name for a given oid.
|
int |
getPGType(java.lang.String pgTypeName)
Look up the oid for a given postgresql type name.
|
java.util.Iterator<java.lang.String> |
getPGTypeNamesWithSQLTypes() |
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(java.lang.String pgTypeName)
Look up the SQL typecode for a given postgresql type name.
|
java.lang.String |
getTypeForAlias(java.lang.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.
|
private java.util.Map<java.lang.String,java.lang.Integer> _pgNameToSQLType
private java.util.Map<java.lang.String,java.lang.String> _pgNameToJavaClass
private java.util.Map<java.lang.Integer,java.lang.String> _oidToPgName
private java.util.Map<java.lang.String,java.lang.Integer> _pgNameToOid
private java.util.Map<java.lang.String,java.lang.Class<? extends PGobject>> _pgNameToPgObject
private java.util.Map<java.lang.Integer,java.lang.Integer> _pgArrayToPgType
private java.util.Map<java.lang.Integer,java.lang.Character> _arrayOidToDelimiter
private BaseConnection _conn
private final int _unknownLength
private java.sql.PreparedStatement _getOidStatementSimple
private java.sql.PreparedStatement _getOidStatementComplexNonArray
private java.sql.PreparedStatement _getOidStatementComplexArray
private java.sql.PreparedStatement _getNameStatement
private java.sql.PreparedStatement _getArrayElementOidStatement
private java.sql.PreparedStatement _getArrayDelimiterStatement
private java.sql.PreparedStatement _getTypeInfoStatement
private static final java.lang.Object[][] types
private static final java.util.HashMap<java.lang.String,java.lang.String> typeAliases
public TypeInfoCache(BaseConnection conn, int unknownLength)
public void addCoreType(java.lang.String pgTypeName,
java.lang.Integer oid,
java.lang.Integer sqlType,
java.lang.String javaClass,
java.lang.Integer arrayOid)
addCoreType in interface TypeInfopublic void addDataType(java.lang.String type,
java.lang.Class<? extends PGobject> klass)
throws java.sql.SQLException
addDataType in interface TypeInfojava.sql.SQLExceptionpublic java.util.Iterator<java.lang.String> getPGTypeNamesWithSQLTypes()
getPGTypeNamesWithSQLTypes in interface TypeInfopublic int getSQLType(int oid)
throws java.sql.SQLException
TypeInfogetSQLType in interface TypeInfooid - the type's OIDTypes) for the typejava.sql.SQLException - if an error occurs when retrieving sql typepublic int getSQLType(java.lang.String pgTypeName)
throws java.sql.SQLException
TypeInfogetSQLType in interface TypeInfopgTypeName - the server type name to look upTypes) for the typejava.sql.SQLException - if an error occurs when retrieving sql typeprivate java.sql.PreparedStatement getOidStatement(java.lang.String pgTypeName)
throws java.sql.SQLException
java.sql.SQLExceptionpublic int getPGType(java.lang.String pgTypeName)
throws java.sql.SQLException
TypeInfoTypeInfo.getPGType(int).public java.lang.String getPGType(int oid)
throws java.sql.SQLException
TypeInfoTypeInfo.getPGType(String).public int getPGArrayType(java.lang.String elementTypeName)
throws java.sql.SQLException
TypeInfogetPGArrayType in interface TypeInfoelementTypeName - the base type'sjava.sql.SQLException - if an error occurs when retrieving array typeprotected int convertArrayToBaseOid(int oid)
oid - input oidpublic char getArrayDelimiter(int oid)
throws java.sql.SQLException
TypeInfogetArrayDelimiter in interface TypeInfooid - the array type's OIDjava.sql.SQLException - if an error occurs when retrieving array delimiterpublic int getPGArrayElement(int oid)
throws java.sql.SQLException
TypeInfogetPGArrayElement in interface TypeInfooid - the array type's OIDjava.sql.SQLException - if an error occurs when retrieving array elementpublic java.lang.Class<? extends PGobject> getPGobject(java.lang.String type)
getPGobject in interface TypeInfopublic java.lang.String getJavaClass(int oid)
throws java.sql.SQLException
getJavaClass in interface TypeInfojava.sql.SQLExceptionpublic java.lang.String getTypeForAlias(java.lang.String alias)
getTypeForAlias in interface TypeInfopublic int getPrecision(int oid,
int typmod)
getPrecision in interface TypeInfopublic boolean isCaseSensitive(int oid)
isCaseSensitive in interface TypeInfopublic int getDisplaySize(int oid,
int typmod)
getDisplaySize in interface TypeInfopublic int getMaximumPrecision(int oid)
getMaximumPrecision in interface TypeInfopublic boolean requiresQuoting(int oid)
throws java.sql.SQLException
requiresQuoting in interface TypeInfojava.sql.SQLExceptionpublic boolean requiresQuotingSqlType(int sqlType)
throws java.sql.SQLException
requiresQuotingSqlType in interface TypeInfosqlType - sql type as in java.sql.Typesjava.sql.SQLException - if something goes wrong