use of com.qlangtech.tis.fs.ITaskContext in project plugins by qlangtech.
the class HiveFlatTableBuilder method startTask.
@Override
public void startTask(ITableBuildTask dumpTask) {
final Connection conn = getConnection();
final DelegatingConnection delegate = new DelegatingConnection(conn) {
@Override
public void close() throws SQLException {
throw new UnsupportedOperationException("in exec phrase close is not supported");
}
};
ITaskContext context = new ITaskContext() {
@Override
public Connection getObj() {
return delegate;
}
};
try {
dumpTask.process(context);
} catch (Exception e) {
throw new RuntimeException(e);
} finally {
try {
conn.close();
} catch (Exception e) {
}
}
}
use of com.qlangtech.tis.fs.ITaskContext in project tis by qlangtech.
the class MockFlatTableBuilder method startTask.
@Override
public void startTask(ITableBuildTask dumpTask) {
final Connection conn = null;
ITaskContext context = new ITaskContext() {
@Override
public Connection getObj() {
return conn;
}
};
try {
dumpTask.process(context);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
Aggregations