Hi,
We are using Liquibase (2.0.5) with SQLite database. If SQL statement have ‘?’ in it, so we gets error like,
- [java] Caused By: not implemented by SQLite JDBC driver
- [java] at liquibase.changelog.ChangeSet.execute(ChangeSet.java:347)
- [java] at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor
- .java:27)
- [java] at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.j
- ava:58)
- [java] at liquibase.Liquibase.update(Liquibase.java:114)
- [java] at liquibase.integration.commandline.Main.doMigration(Main.java:
- 825)
- [java] at liquibase.integration.commandline.Main.main(Main.java:134)
Changelog for SQL is like:
- error full query
- UPDATE person set question =‘How many times?’ where id = ‘howtried’;
If i update class “liquibase.executor.jvm.JdbcExecutor” in liquibase as below, it works fine.
I want to know,
- is this change safe?
- is there any other way to solve this problem?
- Should i file bug and wait for new Liquibase version?
- class ExecuteStatementCallback implements StatementCallback {
- public Object doInStatement(Statement stmt) throws SQLException, DatabaseException {
- for (String statement : applyVisitors(sql, sqlVisitors)) {
- if (database instanceof OracleDatabase) {
- statement = statement.replaceFirst("/\s*/\s*$", “”); //remove duplicated /'s
- }
- log.debug(“Executing EXECUTE database command: “+statement);
- // if (statement.contains(”?”)) {
- // stmt.setEscapeProcessing(true);
- // }
- try {
- stmt.execute(statement);
- } catch (SQLException e) {
- throw e;
- }
- }
- return null;
- }
I have just comment “stmt.setEscapeProcessing(true);” it works fine.
Please guide me in this scenario.