Thanks, I’ll get that change in
Nathan
Thanks, I’ll get that change in
Nathan
I have modified JdbcExecutor to set setEscapeProcessing and it is working.
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(false);
}
if (statement.contains("{")) {
stmt.setEscapeProcessing(false);
}
try {
stmt.execute(statement);
} catch (SQLException e) {
throw e;
}
}
return null;
}
We try to install “JAVA Source” with liquibase and get a “java.lang.NullPointerException”
<databaseChangeLog
xmlns=“http://www.liquibase.org/xml/ns/dbchangelog”
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”
xmlns:ext=“http://www.liquibase.org/xml/ns/dbchangelog-ext”
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED CWriteCLOB as
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.sql.*;
import oracle.sql.*;
public class CWriteCLOB extends Object
{
public static String PassStrArray(oracle.sql.CLOB p_in, java.lang.String f_in)
throws java.sql.SQLException, IOException
{
int buffer_length;
//int clob_length = (int)p_in.length();
try
{
File target = new File(f_in);
FileWriter fw = new FileWriter(target);
BufferedReader inputReader = new BufferedReader(p_in.getCharacterStream());
BufferedWriter outputWriter = new BufferedWriter(new FileWriter(target));
char[] buffer = new char[8192];
int bufferLength;
while ((bufferLength = inputReader.read(buffer)) != -1)
{
outputWriter.write(buffer, 0, bufferLength);
}
outputWriter.flush();
outputWriter.close();
inputReader.close();
}
catch(Exception e)
{
return e.toString();
}
return “0”;
}
}
The JDBC Driver has problems with round braces and the only workaround is to "Is there a way to enable this in liquibase
Hi there,
The last post was 7 months ago and looking in the source today I see that this change is not yet in the code line,
I was wondering whether there’s a release number or date when this change will be added.
Thanks,
Robert
Hi.
I’m using Liquibase 2.0.5 and have this bug too. Is threr a plan to correct it in 2.x.x version?
It is not fixed in liquibase-3.0.0-beta2-bin.zip