2 * ================================================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ================================================================================
20 package org.openecomp.portalsdk.analytics.system.fusion;
22 import java.sql.Connection;
23 import java.sql.ResultSet;
24 import java.sql.SQLException;
25 import java.sql.Statement;
27 import javax.servlet.ServletContext;
29 import org.openecomp.portalsdk.analytics.error.ReportSQLException;
30 import org.openecomp.portalsdk.analytics.system.RDbUtils;
31 import org.openecomp.portalsdk.analytics.system.fusion.adapter.RaptorAdapter;
32 import org.openecomp.portalsdk.analytics.system.fusion.adapter.SpringContext;
33 import org.openecomp.portalsdk.analytics.util.DataSet;
34 import org.openecomp.portalsdk.analytics.util.Log;
35 import org.springframework.beans.factory.annotation.Autowired;
39 public class RemoteDbUtils implements RDbUtils{
41 private RaptorAdapter raptorAdapter;
44 public void initializeDbUtils(ServletContext servletContext) {
45 raptorAdapter = (RaptorAdapter)SpringContext.getApplicationContext().getBean("raptorAdapter");
46 } // initializeDbUtils
49 public Connection getRemoteConnection(String dbKey) {
50 return raptorAdapter.getConnection(dbKey);
53 public void clearConnection(Connection conn) {
54 raptorAdapter.releaseConnection(conn);