I'm using the "pure" SQLite JDBC driver¹ and trying to bootstrap my
database schema by running a batch of DDL statements. I read in the
entire DDL script from a file, collect it into a string, and feed that
string into either java.sql.Statement.executeUpdate() or
java.sql.Statement.executeBatch().

In either case, only the first DDL statement takes effect, and no
errors are signaled. Stepping through the JDBC driver, it looks as
though it sqlite3_prepare()s a statement with my SQL string, then
calls sqlite3_step() on the statement, and the return value comes back
as SQLITE_DONE, upon which it finalizes the statement and returns
successfully.

I understand that we have this JDBC layer in the middle, but it's
pretty thin, and I'm trying to figure out which party in this
arrangement is responsible for only executing the first statement (up
through the first semicolon) in the SQL string.

Does SQLite normally execute more than one statement provided in a SQL
string? I'm fearing having to cut up this DDL file into ten parts:
three CREATE TABLE statements, one CREATE INDEX statement, and six
CREATE TRIGGER statements for foreign key enforcement.

Please advise.


Footnotes: 
¹ http://www.zentus.com/sqlitejdbc/

-- 
Steven E. Harris

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to