Codota Logo
TypeInfoCache
Code IndexAdd Codota to your IDE (free)

How to use
TypeInfoCache
in
org.postgresql.jdbc2

Best Java code snippets using org.postgresql.jdbc2.TypeInfoCache (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
origin: postgresql/postgresql

protected TypeInfo createTypeInfo(BaseConnection conn, int unknownLength)
{
  return new TypeInfoCache(conn, unknownLength);
}
origin: postgresql/postgresql

public TypeInfoCache(BaseConnection conn, int unknownLength)
{
  _conn = conn;
  _unknownLength = unknownLength;
  _oidToPgName = new HashMap();
  _pgNameToOid = new HashMap();
  _pgNameToJavaClass = new HashMap();
  _pgNameToPgObject = new HashMap();
  _pgArrayToPgType = new HashMap();
  _arrayOidToDelimiter = new HashMap();
  // needs to be synchronized because the iterator is returned
  // from getPGTypeNamesWithSQLTypes()
  _pgNameToSQLType = Collections.synchronizedMap(new HashMap());
  for (int i=0; i<types.length; i++) {
    String pgTypeName = (String)types[i][0];
    Integer oid = (Integer)types[i][1];
    Integer sqlType = (Integer)types[i][2];
    String javaClass = (String)types[i][3];
    Integer arrayOid = (Integer)types[i][4];
    addCoreType(pgTypeName, oid, sqlType, javaClass, arrayOid);
  }
}
origin: postgresql/postgresql

public boolean isSigned(int oid) {
  oid = convertArrayToBaseOid(oid);
  switch(oid) {
    case Oid.INT2:
    case Oid.INT4:
    case Oid.INT8:
    case Oid.FLOAT4:
    case Oid.FLOAT8:
    case Oid.NUMERIC:
      return true;
    default:
      return false;
  }
}
origin: postgresql/postgresql

public int getPGArrayType(String elementTypeName) throws SQLException
{
  elementTypeName = getTypeForAlias(elementTypeName);
  return getPGType("_" + elementTypeName);
}
origin: postgresql/postgresql

public int getSQLType(int oid) throws SQLException
{
  return getSQLType(getPGType(oid));
}
origin: postgresql/postgresql

public int getPrecision(int oid, int typmod) {
  oid = convertArrayToBaseOid(oid);
  switch (oid) {
    case Oid.INT2:
    case Oid.TIMESTAMP:
    case Oid.TIMESTAMPTZ:
      return getDisplaySize(oid, typmod);
origin: postgresql/postgresql

public boolean requiresQuoting(int oid) throws SQLException
{
  int sqlType = getSQLType(oid);
  switch(sqlType) {
    case Types.BIGINT:
    case Types.DOUBLE:
    case Types.FLOAT:
    case Types.INTEGER:
    case Types.REAL:
    case Types.SMALLINT:
    case Types.TINYINT:
    case Types.NUMERIC:
    case Types.DECIMAL:
      return false;
  }
  return true;
}
origin: postgresql/postgresql

public synchronized String getJavaClass(int oid) throws SQLException
{
  String pgTypeName = getPGType(oid);
  String result = (String)_pgNameToJavaClass.get(pgTypeName);
  if (result != null) {
    return result;
  }
  if (getSQLType(pgTypeName) == Types.ARRAY) {
    result = "java.sql.Array";
    _pgNameToJavaClass.put(pgTypeName, result);
  }
  return result;
}
origin: org.ancoron.postgresql/org.postgresql.osgi

public int getPGArrayType(String elementTypeName) throws SQLException
{
  elementTypeName = getTypeForAlias(elementTypeName);
  return getPGType("_" + elementTypeName);
}
origin: org.ancoron.postgresql/org.postgresql

public int getPrecision(int oid, int typmod) {
  oid = convertArrayToBaseOid(oid);
  switch (oid) {
    case Oid.INT2:
    case Oid.TIMESTAMP:
    case Oid.TIMESTAMPTZ:
      return getDisplaySize(oid, typmod);
origin: org.ancoron.postgresql/org.postgresql.osgi

public boolean requiresQuoting(int oid) throws SQLException
{
  int sqlType = getSQLType(oid);
  switch(sqlType) {
    case Types.BIGINT:
    case Types.DOUBLE:
    case Types.FLOAT:
    case Types.INTEGER:
    case Types.REAL:
    case Types.SMALLINT:
    case Types.TINYINT:
    case Types.NUMERIC:
    case Types.DECIMAL:
      return false;
  }
  return true;
}
origin: org.ancoron.postgresql/org.postgresql.osgi

public int getSQLType(int oid) throws SQLException
{
  return getSQLType(getPGType(oid));
}
origin: postgresql/postgresql

public boolean isCaseSensitive(int oid) {
  oid = convertArrayToBaseOid(oid);
  switch(oid) {
    case Oid.OID:
    case Oid.INT2:
    case Oid.INT4:
    case Oid.INT8:
    case Oid.FLOAT4:
    case Oid.FLOAT8:
    case Oid.NUMERIC:
    case Oid.BOOL:
    case Oid.BIT:
    case Oid.VARBIT:
    case Oid.DATE:
    case Oid.TIME:
    case Oid.TIMETZ:
    case Oid.TIMESTAMP:
    case Oid.TIMESTAMPTZ:
    case Oid.INTERVAL:
      return false;
    default:
      return true;
  }
}
origin: org.ancoron.postgresql/org.postgresql

public int getPGArrayType(String elementTypeName) throws SQLException
{
  elementTypeName = getTypeForAlias(elementTypeName);
  return getPGType("_" + elementTypeName);
}
origin: org.ancoron.postgresql/org.postgresql.osgi

public int getPrecision(int oid, int typmod) {
  oid = convertArrayToBaseOid(oid);
  switch (oid) {
    case Oid.INT2:
    case Oid.TIMESTAMP:
    case Oid.TIMESTAMPTZ:
      return getDisplaySize(oid, typmod);
origin: org.ancoron.postgresql/org.postgresql.osgi

protected TypeInfo createTypeInfo(BaseConnection conn, int unknownLength)
{
  return new TypeInfoCache(conn, unknownLength);
}
origin: org.ancoron.postgresql/org.postgresql

public boolean requiresQuoting(int oid) throws SQLException
{
  int sqlType = getSQLType(oid);
  switch(sqlType) {
    case Types.BIGINT:
    case Types.DOUBLE:
    case Types.FLOAT:
    case Types.INTEGER:
    case Types.REAL:
    case Types.SMALLINT:
    case Types.TINYINT:
    case Types.NUMERIC:
    case Types.DECIMAL:
      return false;
  }
  return true;
}
origin: org.ancoron.postgresql/org.postgresql.osgi

public TypeInfoCache(BaseConnection conn, int unknownLength)
{
  _conn = conn;
  _unknownLength = unknownLength;
  _oidToPgName = new HashMap();
  _pgNameToOid = new HashMap();
  _pgNameToJavaClass = new HashMap();
  _pgNameToPgObject = new HashMap();
  _pgArrayToPgType = new HashMap();
  _arrayOidToDelimiter = new HashMap();
  // needs to be synchronized because the iterator is returned
  // from getPGTypeNamesWithSQLTypes()
  _pgNameToSQLType = Collections.synchronizedMap(new HashMap());
  for (int i=0; i<types.length; i++) {
    String pgTypeName = (String)types[i][0];
    Integer oid = (Integer)types[i][1];
    Integer sqlType = (Integer)types[i][2];
    String javaClass = (String)types[i][3];
    Integer arrayOid = (Integer)types[i][4];
    addCoreType(pgTypeName, oid, sqlType, javaClass, arrayOid);
  }
}
origin: org.ancoron.postgresql/org.postgresql

public int getSQLType(int oid) throws SQLException
{
  return getSQLType(getPGType(oid));
}
origin: postgresql/postgresql

public int getMaximumPrecision(int oid) {
  oid = convertArrayToBaseOid(oid);
  switch(oid) {
    case Oid.NUMERIC:
      return 1000;
    case Oid.TIME:
    case Oid.TIMETZ:
      // Technically this depends on the --enable-integer-datetimes
      // configure setting.  It is 6 with integer and 10 with float.
      return 6;
    case Oid.TIMESTAMP:
    case Oid.TIMESTAMPTZ:
    case Oid.INTERVAL:
      return 6;
    case Oid.BPCHAR:
    case Oid.VARCHAR:
      return 10485760;
    case Oid.BIT:
    case Oid.VARBIT:
      return 83886080;
    default:
      return 0;
  }
}
org.postgresql.jdbc2TypeInfoCache

Most used methods

  • <init>
  • addCoreType
  • convertArrayToBaseOid
    Return the oid of the array's base element if it's an array, if not return the provided oid. This do
  • getDisplaySize
  • getPGType
  • getSQLType
  • getTypeForAlias

Popular in Java

  • Making http post requests using okhttp
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • orElseThrow (Optional)
  • findViewById (Activity)
  • BufferedReader (java.io)
    Reads text from a character-input stream, buffering characters so as to provide for the efficient re
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • MessageFormat (java.text)
    MessageFormat provides a means to produce concatenated messages in language-neutral way. Use this to
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • TreeMap (java.util)
    A Red-Black tree based NavigableMap implementation. The map is sorted according to the Comparable of
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now