I create two tables with relationship between them with UCanAccess. But it doesnt create the relationship. Why? What is wrong? How can i solve this problem?
statement.execute("CREATE TABLE example1 (ExId LONG PRIMARY KEY, Title TEXT) ");
statement.execute("CREATE TABLE example2 (Id COUNTER PRIMARY KEY," +
" ExId LONG REFERENCES example1(ExId), Description TEXT)");
Nothing bad in your DDL statement, but UCanAccess has some limits in the DDL support. That it can't create foreign keys is one of those limits. Currently UCanAccess can create primary key and indexes(unique or not). It can obviously read and apply all the existent foreign key constraints. Actually, the underlying library jackcess can read foreign key contraints but it can't still create them. I hope to be able to enhance the DDL support in the future.