[Bug] ResultSet#getMetaData() returns null

From: Doug Kearns <djkea2(at)mugca(dot)its(dot)monash(dot)edu(dot)au>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: [Bug] ResultSet#getMetaData() returns null
Date: 2003-05-18 13:23:41
Message-ID: 20030518132341.GA18771@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hello all,

ResultSet#getMetaData() is returning null, using the current CVS driver,
if called before ResultSet#next()

<snippet>
db.setAutoCommit(false);

CallableStatement st = db.prepareCall( "{ ? = call doit () }" );
st.registerOutParameter(1, Types.OTHER);

st.execute();
ResultSet rs = (ResultSet) st.getObject(1);

ResultSetMetaData md = rs.getMetaData();
System.out.println( "Column count = " + md.getColumnCount() );
//Exception in thread "main" java.lang.NullPointerException
//at org.postgresql.jdbc2.AbstractJdbc2ResultSetMetaData.getColumnCount(AbstractJdbc2ResultSetMetaData.java:33)
//at JDBCTest.main(JDBCTest.java:16)

rs.next();
</snippet>

Regards,
Doug

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Barry Lind 2003-05-19 04:25:41 Re: [PATCH] Fix COLUMN_SIZE and NUM_PREC_RADIX in metadata
Previous Message Barry Lind 2003-05-16 17:25:23 Re: Problem about executeUpdate and stored procedure that