public final class APIMgtDBUtil extends Object
| Constructor and Description |
|---|
APIMgtDBUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
closeAllConnections(PreparedStatement preparedStatement,
Connection connection,
ResultSet resultSet)
Utility method to close the connection streams.
|
static Connection |
getConnection()
Utility method to get a new database connection (to AppMgt Database)
|
static Connection |
getUiActivityDBConnection()
Utility method to get a UI activity Publish specific database connection
|
static void |
initialize()
Initializes the data source
|
static DataSource |
initializeDataSource(String dataSourceName)
Initialize received data source
|
public static void initialize()
throws Exception
org.wso2.carbon.appmgt.api.AppManagementException - if an error occurs while loading DB configurationExceptionpublic static DataSource initializeDataSource(String dataSourceName) throws org.wso2.carbon.appmgt.api.AppManagementException
dataSourceName - : Data source name needs to be initializedorg.wso2.carbon.appmgt.api.AppManagementException - if an error occurs while initializing the data sourcepublic static Connection getConnection() throws SQLException
SQLException - if failed to get Connectionpublic static Connection getUiActivityDBConnection() throws SQLException
SQLException - if failed to get Connectionpublic static void closeAllConnections(PreparedStatement preparedStatement, Connection connection, ResultSet resultSet)
preparedStatement - PreparedStatementconnection - ConnectionresultSet - ResultSetCopyright © 2017 WSO2. All rights reserved.