I am trying to merge two sqlite tables by dumping the contents of one into another. However, each time I attempt this, a syntax error is thrown, stating "[SQLITE_ERROR] SQL Error or missing database (near "sqlite3": syntax error)"
conn is the connection of the original database, which I send all sql commands. newConn is the connection of the database to be merged.
How can I fix this issue? Thank you in advance!
EDIT: I just wanted to make sure this doesn't get closed for being a duplicate. I used the sql code from here, but it's still causing problems.
newConn = DriverManager.getConnection("jdbc:sqlite:" + path);
String sqlMerge = "sqlite3 ? .dump";
conn.setAutoCommit(false);
PreparedStatement pstmt1 = conn.prepareStatement(sqlMerge);
pstmt1.setString(1, newConn.getCatalog());
pstmt1.executeUpdate();
conn.commit();