1. Taro L. Saito
  2. sqlite-jdbc
Issue #43 resolved

ResultSetMetaData does not return the SQL Type if there are no results from the query

Grace Batumbya
created an issue

(From https://groups.google.com/d/topic/xerial/Aqu9XtLqAYk/discussion)

Hi all,

If I run the following in my Unit test I see all the SQL types returned as 0

rs = st.executeQuery("SELECT * FROM Orders WHERE 1=0");

ResultSetMetaData rsMetaData = rs.getMetaData(); for (int i = 1; i <= rsMetaData.getColumnCount(); i++) { log.info(rsMetaData.getColumnName(i) + " " + rsMetaData.isAutoIncrement(i) + " " + rsMetaData.getColumnType(i)); }

Result: INFO May 15 07:09:10 net.sf.pinf.TestSQLite - ID true 0 INFO May 15 07:09:10 net.sf.pinf.TestSQLite - NAME false 0 INFO May 15 07:09:10 net.sf.pinf.TestSQLite - Customer_ID false 0 INFO May 15 07:09:10 net.sf.pinf.TestSQLite - CREATED false 0

If I try this with other jdbc drivers on different databases I do get the types back.

Comments (1)

  1. Log in to comment