For example when I call the method:


I whould expect to see the SQL Type BLOB mapped as an oid.

see attach

Ricardo Maia

On Wednesday 01 August 2001 23:29, Rene Pijlman wrote:
> On Wed, 1 Aug 2001 22:49:40 +0100, Ricardo Maia wrote:
> >The problem is that, as the PostgreSQL JDBC driver doesn't
> >follow JDBC Standard I had to write some specific code for
> >use it with PostgreSQL DB.
> So what exactly are the deviations from the standard that you
> encountered?
> Regards,
> René Pijlman
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
package databasetest;

import java.sql.*;

public class GetTypesInfo {

  public static void main(String args[ ]) {

    String url = "jdbc:postgresql://";

    Connection con;

    DatabaseMetaData dbmd;

    try {
    } catch(java.lang.ClassNotFoundException e) {
      System.err.print("ClassNotFoundException: ");

    try {
      con = DriverManager.getConnection(url,"bobby", "tareco");

      dbmd = con.getMetaData();

      ResultSet rs = dbmd.getTypeInfo();

      while ( {

        String typeName = rs.getString("TYPE_NAME");

        short dataType = rs.getShort("DATA_TYPE");

        String createParams = rs.getString("CREATE_PARAMS");

        int nullable = rs.getInt("NULLABLE");

        boolean caseSensitive = rs.getBoolean("CASE_SENSITIVE");

        if(dataType != java.sql.Types.OTHER)
          System.out.println("DBMS type " + typeName + ":");
          System.out.println("     java.sql.Types:  "  + typeName(dataType));
          System.out.print("     parameters used to create: ");
          System.out.println("     nullable?:  "  + nullable);
          System.out.print("     case sensitive?:  ");

    } catch(SQLException ex) {
      System.err.println("SQLException: " + ex.getMessage());

  public static String typeName(int i)
      case java.sql.Types.ARRAY: return "ARRAY";
      case java.sql.Types.BIGINT: return "BIGINT";
      case java.sql.Types.BINARY: return "BINARY";
      case java.sql.Types.BIT: return "BIT";
      case java.sql.Types.BLOB: return "BLOB";
      case java.sql.Types.CHAR: return "CHAR";
      case java.sql.Types.CLOB: return "CLOB";
      case java.sql.Types.DATE: return "DATE";
      case java.sql.Types.DECIMAL: return "DECIMAL";
      case java.sql.Types.DISTINCT: return "DISTINCT";
      case java.sql.Types.DOUBLE: return "DOUBLE";
      case java.sql.Types.FLOAT: return "FLOAT";
      case java.sql.Types.INTEGER: return "INTEGER";
      case java.sql.Types.JAVA_OBJECT: return "JAVA_OBJECT";
      case java.sql.Types.LONGVARBINARY: return "LONGVARBINARY";
      case java.sql.Types.LONGVARCHAR: return "LONGVARCHAR";
      case java.sql.Types.NULL: return "NULL";
      case java.sql.Types.NUMERIC: return "NUMERIC";
      case java.sql.Types.OTHER: return "OTHER";
      case java.sql.Types.REAL: return "REAL";
      case java.sql.Types.REF: return "REF";
      case java.sql.Types.SMALLINT: return "SMALLINT";
      case java.sql.Types.STRUCT: return "STRUCT";
      case java.sql.Types.TIME: return "TIME";
      case java.sql.Types.TIMESTAMP: return "TIMESTAMP";
      case java.sql.Types.TINYINT: return "TINYINT";
      case java.sql.Types.VARBINARY: return "VARBINARY";
      case java.sql.Types.VARCHAR: return "VARCHAR";
      default: return "";

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

Reply via email to