@Test public void executeFailValidation() throws Exception { final Map<String, String> resultMap = new SQLScript().execute(EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY); assertThat(resultMap.get(RETURN_CODE), is(FAILURE)); assertThat(resultMap.get(RETURN_RESULT), is("dbServerName can't be empty\nusername input is empty.\npassword input is empty.\ndatabase input is empty.\ntrustStore or trustStorePassword is mandatory if trustAllRoots is false\nOnly one of the sqlCommands and scriptFileName can be specified")); }
@Action(name = "SQL Script", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(EXCEPTION), @Output(UPDATE_COUNT), }, responses = { @Response(text = ResponseNames.SUCCESS, field = RETURN_CODE, value = SUCCESS, matchType = MatchType.COMPARE_EQUAL, responseType = ResponseType.RESOLVED), @Response(text = ResponseNames.FAILURE, field = RETURN_CODE, value = FAILURE, matchType = MatchType.COMPARE_EQUAL, responseType = ResponseType.ERROR, isOnFail = true) }) public Map<String, String> execute(@Param(value = DB_SERVER_NAME, required = true) String dbServerName, @Param(value = DB_TYPE) String dbType, @Param(value = USERNAME) String username, @Param(value = PASSWORD, encrypted = true) String password, @Param(value = INSTANCE) String instance, @Param(value = DB_PORT) String dbPort, @Param(value = DATABASE_NAME, required = true) String databaseName, @Param(value = AUTHENTICATION_TYPE) String authenticationType, @Param(value = DB_CLASS) String dbClass, @Param(value = DB_URL) String dbURL, @Param(value = DELIMITER) String delimiter, @Param(value = SQL_COMMANDS) String sqlCommands, @Param(value = SCRIPT_FILE_NAME) String scriptFileName, @Param(value = TRUST_ALL_ROOTS) String trustAllRoots, @Param(value = TRUST_STORE) String trustStore, @Param(value = TRUST_STORE_PASSWORD) String trustStorePassword, @Param(value = AUTH_LIBRARY_PATH) String authLibraryPath, @Param(value = DATABASE_POOLING_PROPERTIES) String databasePoolingProperties, @Param(value = RESULT_SET_TYPE) String resultSetType, @Param(value = RESULT_SET_CONCURRENCY) String resultSetConcurrency) { dbType = defaultIfEmpty(dbType, ORACLE_DB_TYPE); username = defaultIfEmpty(username, EMPTY); password = defaultIfEmpty(password, EMPTY); instance = defaultIfEmpty(instance, EMPTY); authenticationType = defaultIfEmpty(authenticationType, AUTH_SQL); trustAllRoots = defaultIfEmpty(trustAllRoots, FALSE); trustStore = defaultIfEmpty(trustStore, EMPTY); trustStorePassword = defaultIfEmpty(trustStorePassword, EMPTY); resultSetType = defaultIfEmpty(resultSetType, TYPE_SCROLL_INSENSITIVE); resultSetConcurrency = defaultIfEmpty(resultSetConcurrency, CONCUR_READ_ONLY); final List<String> preInputsValidation = validateSqlScriptInputs(dbServerName, dbType, username, password, instance, dbPort, databaseName, authenticationType, sqlCommands, scriptFileName, trustAllRoots, trustStore, trustStorePassword, resultSetType, resultSetConcurrency, authLibraryPath); if (!preInputsValidation.isEmpty()) { return getFailureResultsMap(StringUtils.join(preInputsValidation, NEW_LINE)); } dbType = getDbType(dbType); delimiter = defaultIfEmpty(delimiter, SEMI_COLON); final SQLInputs sqlInputs = SQLInputs.builder() .dbServer(dbServerName) .dbType(dbType) .username(username) .password(password) .instance(instance) .dbPort(getOrDefaultDBPort(dbPort, dbType)) .dbName(defaultIfEmpty(databaseName, EMPTY)) .authenticationType(authenticationType) .dbClass(getOrDefaultDBClass(dbClass, dbType)) .dbUrl(defaultIfEmpty(dbURL, EMPTY)) .strDelim(delimiter) .sqlCommands(getSqlCommands(sqlCommands, scriptFileName, delimiter)) .trustAllRoots(toBoolean(trustAllRoots)) .trustStore(trustStore) .trustStorePassword(trustStorePassword) .authLibraryPath(authLibraryPath) .databasePoolingProperties(getOrDefaultDBPoolingProperties(databasePoolingProperties, EMPTY)) .resultSetType(getResultSetType(resultSetType)) .resultSetConcurrency(getResultSetConcurrency(resultSetConcurrency)) .isNetcool(checkIsNetcool(dbType)) .build(); try { final List<String> commands = sqlInputs.getSqlCommands(); if (!commands.isEmpty()) { final String res = SQLScriptService.executeSqlScript(commands, sqlInputs); final Map<String, String> result = getSuccessResultsMap(res); result.put(UPDATE_COUNT, String.valueOf(sqlInputs.getIUpdateCount())); return result; } return getFailureResultsMap(NO_SQL_COMMAND); } catch (Exception e) { return getFailureResultsMap(e); } }
SQLScript { @Action(name = "SQL Script", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(EXCEPTION), @Output(UPDATE_COUNT), }, responses = { @Response(text = ResponseNames.SUCCESS, field = RETURN_CODE, value = SUCCESS, matchType = MatchType.COMPARE_EQUAL, responseType = ResponseType.RESOLVED), @Response(text = ResponseNames.FAILURE, field = RETURN_CODE, value = FAILURE, matchType = MatchType.COMPARE_EQUAL, responseType = ResponseType.ERROR, isOnFail = true) }) public Map<String, String> execute(@Param(value = DB_SERVER_NAME, required = true) String dbServerName, @Param(value = DB_TYPE) String dbType, @Param(value = USERNAME) String username, @Param(value = PASSWORD, encrypted = true) String password, @Param(value = INSTANCE) String instance, @Param(value = DB_PORT) String dbPort, @Param(value = DATABASE_NAME, required = true) String databaseName, @Param(value = AUTHENTICATION_TYPE) String authenticationType, @Param(value = DB_CLASS) String dbClass, @Param(value = DB_URL) String dbURL, @Param(value = DELIMITER) String delimiter, @Param(value = SQL_COMMANDS) String sqlCommands, @Param(value = SCRIPT_FILE_NAME) String scriptFileName, @Param(value = TRUST_ALL_ROOTS) String trustAllRoots, @Param(value = TRUST_STORE) String trustStore, @Param(value = TRUST_STORE_PASSWORD) String trustStorePassword, @Param(value = AUTH_LIBRARY_PATH) String authLibraryPath, @Param(value = DATABASE_POOLING_PROPERTIES) String databasePoolingProperties, @Param(value = RESULT_SET_TYPE) String resultSetType, @Param(value = RESULT_SET_CONCURRENCY) String resultSetConcurrency) { dbType = defaultIfEmpty(dbType, ORACLE_DB_TYPE); username = defaultIfEmpty(username, EMPTY); password = defaultIfEmpty(password, EMPTY); instance = defaultIfEmpty(instance, EMPTY); authenticationType = defaultIfEmpty(authenticationType, AUTH_SQL); trustAllRoots = defaultIfEmpty(trustAllRoots, FALSE); trustStore = defaultIfEmpty(trustStore, EMPTY); trustStorePassword = defaultIfEmpty(trustStorePassword, EMPTY); resultSetType = defaultIfEmpty(resultSetType, TYPE_SCROLL_INSENSITIVE); resultSetConcurrency = defaultIfEmpty(resultSetConcurrency, CONCUR_READ_ONLY); final List<String> preInputsValidation = validateSqlScriptInputs(dbServerName, dbType, username, password, instance, dbPort, databaseName, authenticationType, sqlCommands, scriptFileName, trustAllRoots, trustStore, trustStorePassword, resultSetType, resultSetConcurrency, authLibraryPath); if (!preInputsValidation.isEmpty()) { return getFailureResultsMap(StringUtils.join(preInputsValidation, NEW_LINE)); } dbType = getDbType(dbType); delimiter = defaultIfEmpty(delimiter, SEMI_COLON); final SQLInputs sqlInputs = SQLInputs.builder() .dbServer(dbServerName) .dbType(dbType) .username(username) .password(password) .instance(instance) .dbPort(getOrDefaultDBPort(dbPort, dbType)) .dbName(defaultIfEmpty(databaseName, EMPTY)) .authenticationType(authenticationType) .dbClass(getOrDefaultDBClass(dbClass, dbType)) .dbUrl(defaultIfEmpty(dbURL, EMPTY)) .strDelim(delimiter) .sqlCommands(getSqlCommands(sqlCommands, scriptFileName, delimiter)) .trustAllRoots(toBoolean(trustAllRoots)) .trustStore(trustStore) .trustStorePassword(trustStorePassword) .authLibraryPath(authLibraryPath) .databasePoolingProperties(getOrDefaultDBPoolingProperties(databasePoolingProperties, EMPTY)) .resultSetType(getResultSetType(resultSetType)) .resultSetConcurrency(getResultSetConcurrency(resultSetConcurrency)) .isNetcool(checkIsNetcool(dbType)) .build(); try { final List<String> commands = sqlInputs.getSqlCommands(); if (!commands.isEmpty()) { final String res = SQLScriptService.executeSqlScript(commands, sqlInputs); final Map<String, String> result = getSuccessResultsMap(res); result.put(UPDATE_COUNT, String.valueOf(sqlInputs.getIUpdateCount())); return result; } return getFailureResultsMap(NO_SQL_COMMAND); } catch (Exception e) { return getFailureResultsMap(e); } } }
SQLScript { @Action(name = "SQL Script", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(EXCEPTION), @Output(UPDATE_COUNT), }, responses = { @Response(text = ResponseNames.SUCCESS, field = RETURN_CODE, value = SUCCESS, matchType = MatchType.COMPARE_EQUAL, responseType = ResponseType.RESOLVED), @Response(text = ResponseNames.FAILURE, field = RETURN_CODE, value = FAILURE, matchType = MatchType.COMPARE_EQUAL, responseType = ResponseType.ERROR, isOnFail = true) }) public Map<String, String> execute(@Param(value = DB_SERVER_NAME, required = true) String dbServerName, @Param(value = DB_TYPE) String dbType, @Param(value = USERNAME) String username, @Param(value = PASSWORD, encrypted = true) String password, @Param(value = INSTANCE) String instance, @Param(value = DB_PORT) String dbPort, @Param(value = DATABASE_NAME, required = true) String databaseName, @Param(value = AUTHENTICATION_TYPE) String authenticationType, @Param(value = DB_CLASS) String dbClass, @Param(value = DB_URL) String dbURL, @Param(value = DELIMITER) String delimiter, @Param(value = SQL_COMMANDS) String sqlCommands, @Param(value = SCRIPT_FILE_NAME) String scriptFileName, @Param(value = TRUST_ALL_ROOTS) String trustAllRoots, @Param(value = TRUST_STORE) String trustStore, @Param(value = TRUST_STORE_PASSWORD) String trustStorePassword, @Param(value = AUTH_LIBRARY_PATH) String authLibraryPath, @Param(value = DATABASE_POOLING_PROPERTIES) String databasePoolingProperties, @Param(value = RESULT_SET_TYPE) String resultSetType, @Param(value = RESULT_SET_CONCURRENCY) String resultSetConcurrency) { dbType = defaultIfEmpty(dbType, ORACLE_DB_TYPE); username = defaultIfEmpty(username, EMPTY); password = defaultIfEmpty(password, EMPTY); instance = defaultIfEmpty(instance, EMPTY); authenticationType = defaultIfEmpty(authenticationType, AUTH_SQL); trustAllRoots = defaultIfEmpty(trustAllRoots, FALSE); trustStore = defaultIfEmpty(trustStore, EMPTY); trustStorePassword = defaultIfEmpty(trustStorePassword, EMPTY); resultSetType = defaultIfEmpty(resultSetType, TYPE_SCROLL_INSENSITIVE); resultSetConcurrency = defaultIfEmpty(resultSetConcurrency, CONCUR_READ_ONLY); final List<String> preInputsValidation = validateSqlScriptInputs(dbServerName, dbType, username, password, instance, dbPort, databaseName, authenticationType, sqlCommands, scriptFileName, trustAllRoots, trustStore, trustStorePassword, resultSetType, resultSetConcurrency, authLibraryPath); if (!preInputsValidation.isEmpty()) { return getFailureResultsMap(StringUtils.join(preInputsValidation, NEW_LINE)); } dbType = getDbType(dbType); delimiter = defaultIfEmpty(delimiter, SEMI_COLON); final SQLInputs sqlInputs = SQLInputs.builder() .dbServer(dbServerName) .dbType(dbType) .username(username) .password(password) .instance(instance) .dbPort(getOrDefaultDBPort(dbPort, dbType)) .dbName(defaultIfEmpty(databaseName, EMPTY)) .authenticationType(authenticationType) .dbClass(getOrDefaultDBClass(dbClass, dbType)) .dbUrl(defaultIfEmpty(dbURL, EMPTY)) .strDelim(delimiter) .sqlCommands(getSqlCommands(sqlCommands, scriptFileName, delimiter)) .trustAllRoots(toBoolean(trustAllRoots)) .trustStore(trustStore) .trustStorePassword(trustStorePassword) .authLibraryPath(authLibraryPath) .databasePoolingProperties(getOrDefaultDBPoolingProperties(databasePoolingProperties, EMPTY)) .resultSetType(getResultSetType(resultSetType)) .resultSetConcurrency(getResultSetConcurrency(resultSetConcurrency)) .isNetcool(checkIsNetcool(dbType)) .build(); try { final List<String> commands = sqlInputs.getSqlCommands(); if (!commands.isEmpty()) { final String res = SQLScriptService.executeSqlScript(commands, sqlInputs); final Map<String, String> result = getSuccessResultsMap(res); result.put(UPDATE_COUNT, String.valueOf(sqlInputs.getIUpdateCount())); return result; } return getFailureResultsMap(NO_SQL_COMMAND); } catch (Exception e) { return getFailureResultsMap(e); } }  }
SQLScript { @Action(name = "SQL Script", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(EXCEPTION), @Output(UPDATE_COUNT), }, responses = { @Response(text = ResponseNames.SUCCESS, field = RETURN_CODE, value = SUCCESS, matchType = MatchType.COMPARE_EQUAL, responseType = ResponseType.RESOLVED), @Response(text = ResponseNames.FAILURE, field = RETURN_CODE, value = FAILURE, matchType = MatchType.COMPARE_EQUAL, responseType = ResponseType.ERROR, isOnFail = true) }) public Map<String, String> execute(@Param(value = DB_SERVER_NAME, required = true) String dbServerName, @Param(value = DB_TYPE) String dbType, @Param(value = USERNAME) String username, @Param(value = PASSWORD, encrypted = true) String password, @Param(value = INSTANCE) String instance, @Param(value = DB_PORT) String dbPort, @Param(value = DATABASE_NAME, required = true) String databaseName, @Param(value = AUTHENTICATION_TYPE) String authenticationType, @Param(value = DB_CLASS) String dbClass, @Param(value = DB_URL) String dbURL, @Param(value = DELIMITER) String delimiter, @Param(value = SQL_COMMANDS) String sqlCommands, @Param(value = SCRIPT_FILE_NAME) String scriptFileName, @Param(value = TRUST_ALL_ROOTS) String trustAllRoots, @Param(value = TRUST_STORE) String trustStore, @Param(value = TRUST_STORE_PASSWORD) String trustStorePassword, @Param(value = AUTH_LIBRARY_PATH) String authLibraryPath, @Param(value = DATABASE_POOLING_PROPERTIES) String databasePoolingProperties, @Param(value = RESULT_SET_TYPE) String resultSetType, @Param(value = RESULT_SET_CONCURRENCY) String resultSetConcurrency) { dbType = defaultIfEmpty(dbType, ORACLE_DB_TYPE); username = defaultIfEmpty(username, EMPTY); password = defaultIfEmpty(password, EMPTY); instance = defaultIfEmpty(instance, EMPTY); authenticationType = defaultIfEmpty(authenticationType, AUTH_SQL); trustAllRoots = defaultIfEmpty(trustAllRoots, FALSE); trustStore = defaultIfEmpty(trustStore, EMPTY); trustStorePassword = defaultIfEmpty(trustStorePassword, EMPTY); resultSetType = defaultIfEmpty(resultSetType, TYPE_SCROLL_INSENSITIVE); resultSetConcurrency = defaultIfEmpty(resultSetConcurrency, CONCUR_READ_ONLY); final List<String> preInputsValidation = validateSqlScriptInputs(dbServerName, dbType, username, password, instance, dbPort, databaseName, authenticationType, sqlCommands, scriptFileName, trustAllRoots, trustStore, trustStorePassword, resultSetType, resultSetConcurrency, authLibraryPath); if (!preInputsValidation.isEmpty()) { return getFailureResultsMap(StringUtils.join(preInputsValidation, NEW_LINE)); } dbType = getDbType(dbType); delimiter = defaultIfEmpty(delimiter, SEMI_COLON); final SQLInputs sqlInputs = SQLInputs.builder() .dbServer(dbServerName) .dbType(dbType) .username(username) .password(password) .instance(instance) .dbPort(getOrDefaultDBPort(dbPort, dbType)) .dbName(defaultIfEmpty(databaseName, EMPTY)) .authenticationType(authenticationType) .dbClass(getOrDefaultDBClass(dbClass, dbType)) .dbUrl(defaultIfEmpty(dbURL, EMPTY)) .strDelim(delimiter) .sqlCommands(getSqlCommands(sqlCommands, scriptFileName, delimiter)) .trustAllRoots(toBoolean(trustAllRoots)) .trustStore(trustStore) .trustStorePassword(trustStorePassword) .authLibraryPath(authLibraryPath) .databasePoolingProperties(getOrDefaultDBPoolingProperties(databasePoolingProperties, EMPTY)) .resultSetType(getResultSetType(resultSetType)) .resultSetConcurrency(getResultSetConcurrency(resultSetConcurrency)) .isNetcool(checkIsNetcool(dbType)) .build(); try { final List<String> commands = sqlInputs.getSqlCommands(); if (!commands.isEmpty()) { final String res = SQLScriptService.executeSqlScript(commands, sqlInputs); final Map<String, String> result = getSuccessResultsMap(res); result.put(UPDATE_COUNT, String.valueOf(sqlInputs.getIUpdateCount())); return result; } return getFailureResultsMap(NO_SQL_COMMAND); } catch (Exception e) { return getFailureResultsMap(e); } }  @Action(name = "SQL Script", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(EXCEPTION), @Output(UPDATE_COUNT), }, responses = { @Response(text = ResponseNames.SUCCESS, field = RETURN_CODE, value = SUCCESS, matchType = MatchType.COMPARE_EQUAL, responseType = ResponseType.RESOLVED), @Response(text = ResponseNames.FAILURE, field = RETURN_CODE, value = FAILURE, matchType = MatchType.COMPARE_EQUAL, responseType = ResponseType.ERROR, isOnFail = true) }) Map<String, String> execute(@Param(value = DB_SERVER_NAME, required = true) String dbServerName,
                                       @Param(value = DB_TYPE) String dbType,
                                       @Param(value = USERNAME) String username,
                                       @Param(value = PASSWORD, encrypted = true) String password,
                                       @Param(value = INSTANCE) String instance,
                                       @Param(value = DB_PORT) String dbPort,
                                       @Param(value = DATABASE_NAME, required = true) String databaseName,
                                       @Param(value = AUTHENTICATION_TYPE) String authenticationType,
                                       @Param(value = DB_CLASS) String dbClass,
                                       @Param(value = DB_URL) String dbURL,
                                       @Param(value = DELIMITER) String delimiter,
                                       @Param(value = SQL_COMMANDS) String sqlCommands,
                                       @Param(value = SCRIPT_FILE_NAME) String scriptFileName,
                                       @Param(value = TRUST_ALL_ROOTS) String trustAllRoots,
                                       @Param(value = TRUST_STORE) String trustStore,
                                       @Param(value = TRUST_STORE_PASSWORD) String trustStorePassword,
                                       @Param(value = AUTH_LIBRARY_PATH) String authLibraryPath,
                                       @Param(value = DATABASE_POOLING_PROPERTIES) String databasePoolingProperties,
                                       @Param(value = RESULT_SET_TYPE) String resultSetType,
                                       @Param(value = RESULT_SET_CONCURRENCY) String resultSetConcurrency); }
SQLScript { @Action(name = "SQL Script", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(EXCEPTION), @Output(UPDATE_COUNT), }, responses = { @Response(text = ResponseNames.SUCCESS, field = RETURN_CODE, value = SUCCESS, matchType = MatchType.COMPARE_EQUAL, responseType = ResponseType.RESOLVED), @Response(text = ResponseNames.FAILURE, field = RETURN_CODE, value = FAILURE, matchType = MatchType.COMPARE_EQUAL, responseType = ResponseType.ERROR, isOnFail = true) }) public Map<String, String> execute(@Param(value = DB_SERVER_NAME, required = true) String dbServerName, @Param(value = DB_TYPE) String dbType, @Param(value = USERNAME) String username, @Param(value = PASSWORD, encrypted = true) String password, @Param(value = INSTANCE) String instance, @Param(value = DB_PORT) String dbPort, @Param(value = DATABASE_NAME, required = true) String databaseName, @Param(value = AUTHENTICATION_TYPE) String authenticationType, @Param(value = DB_CLASS) String dbClass, @Param(value = DB_URL) String dbURL, @Param(value = DELIMITER) String delimiter, @Param(value = SQL_COMMANDS) String sqlCommands, @Param(value = SCRIPT_FILE_NAME) String scriptFileName, @Param(value = TRUST_ALL_ROOTS) String trustAllRoots, @Param(value = TRUST_STORE) String trustStore, @Param(value = TRUST_STORE_PASSWORD) String trustStorePassword, @Param(value = AUTH_LIBRARY_PATH) String authLibraryPath, @Param(value = DATABASE_POOLING_PROPERTIES) String databasePoolingProperties, @Param(value = RESULT_SET_TYPE) String resultSetType, @Param(value = RESULT_SET_CONCURRENCY) String resultSetConcurrency) { dbType = defaultIfEmpty(dbType, ORACLE_DB_TYPE); username = defaultIfEmpty(username, EMPTY); password = defaultIfEmpty(password, EMPTY); instance = defaultIfEmpty(instance, EMPTY); authenticationType = defaultIfEmpty(authenticationType, AUTH_SQL); trustAllRoots = defaultIfEmpty(trustAllRoots, FALSE); trustStore = defaultIfEmpty(trustStore, EMPTY); trustStorePassword = defaultIfEmpty(trustStorePassword, EMPTY); resultSetType = defaultIfEmpty(resultSetType, TYPE_SCROLL_INSENSITIVE); resultSetConcurrency = defaultIfEmpty(resultSetConcurrency, CONCUR_READ_ONLY); final List<String> preInputsValidation = validateSqlScriptInputs(dbServerName, dbType, username, password, instance, dbPort, databaseName, authenticationType, sqlCommands, scriptFileName, trustAllRoots, trustStore, trustStorePassword, resultSetType, resultSetConcurrency, authLibraryPath); if (!preInputsValidation.isEmpty()) { return getFailureResultsMap(StringUtils.join(preInputsValidation, NEW_LINE)); } dbType = getDbType(dbType); delimiter = defaultIfEmpty(delimiter, SEMI_COLON); final SQLInputs sqlInputs = SQLInputs.builder() .dbServer(dbServerName) .dbType(dbType) .username(username) .password(password) .instance(instance) .dbPort(getOrDefaultDBPort(dbPort, dbType)) .dbName(defaultIfEmpty(databaseName, EMPTY)) .authenticationType(authenticationType) .dbClass(getOrDefaultDBClass(dbClass, dbType)) .dbUrl(defaultIfEmpty(dbURL, EMPTY)) .strDelim(delimiter) .sqlCommands(getSqlCommands(sqlCommands, scriptFileName, delimiter)) .trustAllRoots(toBoolean(trustAllRoots)) .trustStore(trustStore) .trustStorePassword(trustStorePassword) .authLibraryPath(authLibraryPath) .databasePoolingProperties(getOrDefaultDBPoolingProperties(databasePoolingProperties, EMPTY)) .resultSetType(getResultSetType(resultSetType)) .resultSetConcurrency(getResultSetConcurrency(resultSetConcurrency)) .isNetcool(checkIsNetcool(dbType)) .build(); try { final List<String> commands = sqlInputs.getSqlCommands(); if (!commands.isEmpty()) { final String res = SQLScriptService.executeSqlScript(commands, sqlInputs); final Map<String, String> result = getSuccessResultsMap(res); result.put(UPDATE_COUNT, String.valueOf(sqlInputs.getIUpdateCount())); return result; } return getFailureResultsMap(NO_SQL_COMMAND); } catch (Exception e) { return getFailureResultsMap(e); } }  @Action(name = "SQL Script", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(EXCEPTION), @Output(UPDATE_COUNT), }, responses = { @Response(text = ResponseNames.SUCCESS, field = RETURN_CODE, value = SUCCESS, matchType = MatchType.COMPARE_EQUAL, responseType = ResponseType.RESOLVED), @Response(text = ResponseNames.FAILURE, field = RETURN_CODE, value = FAILURE, matchType = MatchType.COMPARE_EQUAL, responseType = ResponseType.ERROR, isOnFail = true) }) Map<String, String> execute(@Param(value = DB_SERVER_NAME, required = true) String dbServerName,
                                       @Param(value = DB_TYPE) String dbType,
                                       @Param(value = USERNAME) String username,
                                       @Param(value = PASSWORD, encrypted = true) String password,
                                       @Param(value = INSTANCE) String instance,
                                       @Param(value = DB_PORT) String dbPort,
                                       @Param(value = DATABASE_NAME, required = true) String databaseName,
                                       @Param(value = AUTHENTICATION_TYPE) String authenticationType,
                                       @Param(value = DB_CLASS) String dbClass,
                                       @Param(value = DB_URL) String dbURL,
                                       @Param(value = DELIMITER) String delimiter,
                                       @Param(value = SQL_COMMANDS) String sqlCommands,
                                       @Param(value = SCRIPT_FILE_NAME) String scriptFileName,
                                       @Param(value = TRUST_ALL_ROOTS) String trustAllRoots,
                                       @Param(value = TRUST_STORE) String trustStore,
                                       @Param(value = TRUST_STORE_PASSWORD) String trustStorePassword,
                                       @Param(value = AUTH_LIBRARY_PATH) String authLibraryPath,
                                       @Param(value = DATABASE_POOLING_PROPERTIES) String databasePoolingProperties,
                                       @Param(value = RESULT_SET_TYPE) String resultSetType,
                                       @Param(value = RESULT_SET_CONCURRENCY) String resultSetConcurrency);  }