1. Taro L. Saito
  2. sqlite-jdbc
  3. Issues
Issue #46 resolved

org.sqlite.MetaData.getExportedKeys constructs incorrect SQL

Greg Shrago
created an issue

Assuming the following DDL:

create table REFERRED (ID integer primary key not null);

create table REFERRING (ID integer, RID integer, foreign key (RID) references REFERRED(id));

org.sqlite.MetaData.getExportedKeys for REFERRED table throws:

java.sql.SQLException: [SQLITE_ERROR] SQL error or missing database (near ")": syntax error)

at org.sqlite.DB.newSQLException(DB.java:383)

at org.sqlite.DB.newSQLException(DB.java:387)

at org.sqlite.DB.throwex(DB.java:374)

at org.sqlite.NativeDB.prepare(Native Method)

at org.sqlite.DB.prepare(DB.java:123)

at org.sqlite.Stmt.executeQuery(Stmt.java:121)

at org.sqlite.MetaData.getExportedKeys(MetaData.java:941)

Comments (4)

  1. Vasyl Khrystiuk

    sorry my bad

    I've got same error but reasone was realy another - it was related to hibernate. I do not know if it's hibernate, problem or this driver? but i just put my working test project here and you cen look yourself on problem

    In attached project i have two entities: "User" and "Track" Thay are simular BUT "Track" has none fields except id. And this cause hibernate fall:project

  2. Log in to comment