--- /dev/null
+/**\r
+ * Copyright 2017-2021 ZTE Corporation.\r
+ * <p>\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ * <p>\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ * <p>\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.onap.holmes.common.database;\r
+\r
+import org.jdbi.v3.core.Handle;\r
+import org.jdbi.v3.core.Jdbi;\r
+import org.springframework.beans.factory.annotation.Autowired;\r
+import org.springframework.stereotype.Service;\r
+\r
+@Service\r
+public class DbDaoUtil {\r
+ private Jdbi jdbi;\r
+\r
+ @Autowired\r
+ public DbDaoUtil(Jdbi jdbi) {\r
+ this.jdbi = jdbi;\r
+ }\r
+\r
+ public <T> T getJdbiDaoByOnDemand(Class<T> daoClazz) {\r
+ return jdbi.onDemand(daoClazz);\r
+ }\r
+\r
+ @Deprecated\r
+ public Handle getHandle() {\r
+ return jdbi.open();\r
+ }\r
+}\r