|
@@ -119,6 +119,13 @@ public class SqlTask extends AbstractTask {
|
|
|
}
|
|
|
|
|
|
dataSource= processDao.findDataSourceById(sqlParameters.getDatasource());
|
|
|
+
|
|
|
+ if (null == dataSource){
|
|
|
+ logger.error("datasource not exists");
|
|
|
+ exitStatusCode = -1;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
logger.info("datasource name : {} , type : {} , desc : {} , user_id : {} , parameter : {}",
|
|
|
dataSource.getName(),
|
|
|
dataSource.getType(),
|
|
@@ -126,12 +133,6 @@ public class SqlTask extends AbstractTask {
|
|
|
dataSource.getUserId(),
|
|
|
dataSource.getConnectionParams());
|
|
|
|
|
|
- if (dataSource == null){
|
|
|
- logger.error("datasource not exists");
|
|
|
- exitStatusCode = -1;
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
Connection con = null;
|
|
|
List<String> createFuncs = null;
|
|
|
try {
|
|
@@ -177,7 +178,7 @@ public class SqlTask extends AbstractTask {
|
|
|
try {
|
|
|
con.close();
|
|
|
} catch (SQLException e) {
|
|
|
- throw e;
|
|
|
+ logger.error(e.getMessage(),e);
|
|
|
}
|
|
|
}
|
|
|
}
|