Subject | bugs in DatabaseMetaData |
---|---|
Author | Massimo Ferrari |
Post date | 2001-10-31T09:12:56Z |
Some methods in DatabaseMetaData query the db and
just return the resulting
ResultSet, but this has some side effects:
getColumns for example uses a statement like this
select ISGMT.RDB$FIELD_NAME as COLUMN_NAME from
RDB$INDEX_SEGMENTS ISGMT
to get the column names.
But since RDB$FIELD_NAME is declared to be CHAR(31),
the ResultSet will
contain a 31 chars long String, even if the column
name is just e.g. 6 chars
long.
The specs just say that the ResultSet contains a
field COLUMN_NAME with the
name of the column, and IMHO it is a task of the
driver to trim the string
before it is returned.
The same problems applies to other fields (e.g.
TABLE_NAME in getTables).
Massimo
__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com
just return the resulting
ResultSet, but this has some side effects:
getColumns for example uses a statement like this
select ISGMT.RDB$FIELD_NAME as COLUMN_NAME from
RDB$INDEX_SEGMENTS ISGMT
to get the column names.
But since RDB$FIELD_NAME is declared to be CHAR(31),
the ResultSet will
contain a 31 chars long String, even if the column
name is just e.g. 6 chars
long.
The specs just say that the ResultSet contains a
field COLUMN_NAME with the
name of the column, and IMHO it is a task of the
driver to trim the string
before it is returned.
The same problems applies to other fields (e.g.
TABLE_NAME in getTables).
Massimo
__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com