getTypeInfo

From: Jan Motl <yzan(at)volny(dot)cz>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: getTypeInfo
Date: 2016-12-14 12:32:19
Message-ID: 5B93DA20-F6BC-4744-87E7-D5E6741E7056@volny.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi,

I noticed that getTypeInfo() may not return data in the order specified in Oracle documentation (https://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html#getTypeInfo())
Retrieves a description of all the data types supported by this database. They are ordered by DATA_TYPE and then by how closely the data type maps to the corresponding JDBC SQL type.
With the following code snippet:
try (Connection connection = dataSource.getConnection(); ResultSet rs = connection.getMetaData().getTypeInfo()) {
while (rs.next()) {
System.out.println(rs.getInt("DATA_TYPE"));
}
} catch (SQLException e) {}
I am getting DATA_TYPE in a non-monotonic order:
-7
-2
1
12
-5
...

Additional metadata:
JDBC driver: PostgreSQL 9.4.1212
Server version: 9.6beta1.0 (9.6beta1.0)

What do I do wrong?

Best regards,
Jan Motl

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2016-12-14 13:34:21 Re: getTypeInfo
Previous Message Brad DeJong 2016-12-09 14:14:17 Re: logging bug in JDBC driver (https://jdbc.postgresql.org/download/postgresql-9.4.1212.jar)