Skip to content

Revisit ResultSetMetaData results #1319

@vdshb

Description

@vdshb

Methods

  • ResultSetMetaData::getColumnDisplaySize
  • ResultSetMetaData::getPrecision
  • ResultSetMetaData::getScale

For different column types like Types.INTEGER, Types.BIGINT, Types.VARCHAR often return 0 or Integer.MAX_VALUE instead of meaningful values.

This is a proposal to revisit this metadata methods and return meaningful values based on SQL-type.

E.g. for Types.VARCHAR ::getColumnDisplaySize result should be equal to ::getPrecision result.
E.g. for Types.INTEGER ::getPrecision result might be equal to 10 instead of current 0 (10 decimal digits max - PostgreSQL's approach).
E.g. for Types.INTEGER ::getColumnDisplaySize result might be equal to 11 instead of current Integer.MAX_VALUE (10 digits + potential minus sign - PostgreSQL's approach).
E.g. for Types.BIGINT ::getPrecision result might be equal to 19 instead of current 0 (19 decimal digits max - PostgreSQL's approach).
E.g. for Types.BIGINT ::getColumnDisplaySize result might be equal to 20 instead of current Integer.MAX_VALUE (19 digits + potential minus sign - PostgreSQL's approach).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions