-/*-
- * ============LICENSE_START=======================================================
+/*===============LICENSE_START=======================================================
* ONAP : APPC
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
* =============================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* See the License for the specific language governing permissions and
* limitations under the License.
*
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
* ============LICENSE_END=========================================================
*/
String selectQuery = "select " + getselectData + "from " + tableName + " where " + getDataClasue;
return jdbcDataSource.getData(selectQuery, Lists.newArrayList(argList), schema);
+ }
+
+ public static boolean deleteData(String tableName, List<String> argList) throws SQLException {
+ String deleteQuery = "delete from " + tableName;
+ log.info(deleteQuery);
+ return jdbcDataSource.writeData(deleteQuery, Lists.newArrayList(argList), Constants.SCHEMA_SDNCTL);
}
+ public static boolean insertDB(String tableName, List<String> argList, String setClause,String whereClause)
+ throws SQLException {
+ String insertPasswordString = "INSERT INTO " + tableName + " (" + setClause + " ) VALUES (" + whereClause +")";
+ log.info(insertPasswordString + " insert statement " + argList);
+ return jdbcDataSource.writeData(insertPasswordString, Lists.newArrayList(argList), Constants.SCHEMA_SDNCTL);
+ }
public static DBResourceManager initDbLibService() throws IOException {
Properties props = new Properties();
File file = new File("/opt/onap/appc/data/properties/dblib.properties");
return jdbcDataSource;
}
}
+