JDBC Driver patch (ResultSetMetaData.java) - Mailing list pgsql-jdbc

From Ed Yu
Subject JDBC Driver patch (ResultSetMetaData.java)
Date
Msg-id 001b01c1965a$b7766fe0$bf00a8c0@sc.rr.com
Whole thread Raw
List pgsql-jdbc
The following patch defines the method getColumnClassName(), currently
throwing an exception.

450a451,508
> /*
>     The following data type mapping came from ../Field.java.
>
>     "int2",
>     "int4","oid",
>     "int8",
>     "cash","money",
>     "numeric",
>     "float4",
>     "float8",
>     "bpchar","char","char2","char4","char8","char16",
>     "varchar","text","name","filename",
>     "bool",
>     "date",
>     "time",
>     "abstime","timestamp"
>
>     Types.SMALLINT,
>     Types.INTEGER,Types.INTEGER,
>     Types.BIGINT,
>     Types.DOUBLE,Types.DOUBLE,
>     Types.NUMERIC,
>     Types.REAL,
>     Types.DOUBLE,
>     Types.CHAR,Types.CHAR,Types.CHAR,Types.CHAR,Types.CHAR,Types.CHAR,
>     Types.VARCHAR,Types.VARCHAR,Types.VARCHAR,Types.VARCHAR,
>     Types.BIT,
>     Types.DATE,
>     Types.TIME,
>     Types.TIMESTAMP,Types.TIMESTAMP
> */
>
>     int sql_type = getField(column).getSQLType();
>
>     switch (sql_type)
>       {
>       case Types.BIT:
>         return("java.lang.Boolean");
>       case Types.SMALLINT:
>         return("java.lang.Integer");
>       case Types.INTEGER:
>         return("java.lang.Integer");
>       case Types.BIGINT:
>         return("java.lang.Long");
>       case Types.NUMERIC:
>         return("java.math.BigDecimal");
>       case Types.REAL:
>         return("java.lang.Float");
>       case Types.DOUBLE:
>         return("java.lang.Double");
>       case Types.CHAR:
>       case Types.VARCHAR:
>         return("java.lang.String");
>       case Types.DATE:
>       case Types.TIME:
>       case Types.TIMESTAMP:
>         return("java.sql.Timestamp");
>       default:
451a510
>       }


pgsql-jdbc by date:

Previous
From: "Dave Cramer"
Date:
Subject: Re: Patches for JDBC driver (7.1.3)
Next
From: "Ed Yu"
Date:
Subject: JDBC patch for DatabaseMetaData