src/main/java/org/embulk/input/sqlserver/SQLServerInputConnection.java in embulk-input-sqlserver-0.9.1 vs src/main/java/org/embulk/input/sqlserver/SQLServerInputConnection.java in embulk-input-sqlserver-0.9.2
- old
+ new
@@ -4,15 +4,24 @@
import java.sql.SQLException;
import org.embulk.input.jdbc.JdbcInputConnection;
public class SQLServerInputConnection extends JdbcInputConnection {
+ private String transactionIsolationLevel;
+
public SQLServerInputConnection(Connection connection, String schemaName) throws SQLException
{
super(connection, schemaName);
}
+ public SQLServerInputConnection(Connection connection, String schemaName, String transactionIsolationLevel)
+ throws SQLException
+ {
+ super(connection, schemaName);
+ this.transactionIsolationLevel = transactionIsolationLevel;
+ }
+
@Override
protected void setSearchPath(String schema) throws SQLException
{
// NOP
}
@@ -23,9 +32,12 @@
StringBuilder sb = new StringBuilder();
if (schemaName != null) {
sb.append(quoteIdentifierString(schemaName)).append(".");
}
sb.append(quoteIdentifierString(tableName));
+ if (transactionIsolationLevel != null) {
+ sb.append(" with (" + transactionIsolationLevel + ")");
+ }
return sb.toString();
}
}