JDBC driver error with ResultSetMetaData
Date: 6 Jun 2002 15:20:40 -0700
Message-ID: <4194693c.0206061420.3a23f35c_at_posting.google.com>
I have a situation where the following occurs:
I have a prepared statement that I execute returning a result set.
// Execute the query
ResultSet results = ps.executeQuery();
I then pull the meta data from the result set.
ResultSetMetaData meta = results.getMetaData();
int cols = meta.getColumnCount();
I loop through the result set and pull the values, the column type and the column label.
// Put the result into the hashtable
while (results.next()) {
for (int i=1; i<=cols; i++) {
// if obj type = CHAR strip trailing blanks
switch (meta.getColumnType(i))
{
case java.sql.Types.CHAR:
obj = results.getObject(i);
if (obj != null) {
hReturn.put(meta.getColumnLabel(i).toUpperCase(),
obj.toString().trim());
[Quoted] At some stage the getColumnLabel starts to return nulls instead of strings (actually the only this seems to happen is with numeric types), even while still within the same result set, and even though a previous call has been successful!!!
This problem does not occur with Informix JDBC against the Informix DB or with the Merant JDBC Drivers against Oracle 8i
It does occur with HP-UX 11i, JDK 1.3, JDBC drivers for 8i and 9i as loaded from the CDs and downloaded from the OTN site. We have tried against Oracle RDBMS 8.1.7 and 9.0.1
Using the debug jar and setting tracing on shows nothing obvious.
Any ideas? otherwise it's $2.5K to Datadirect for every system we ship or shifting back to Informix...
Regards, Chris Received on Fri Jun 07 2002 - 00:20:40 CEST