public class MLDatabaseUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
closeDatabaseResources(Connection connection)
Close a given set of database resources.
|
static void |
closeDatabaseResources(Connection connection,
PreparedStatement preparedStatement)
Close a given set of database resources.
|
static void |
closeDatabaseResources(Connection connection,
PreparedStatement preparedStatement,
ResultSet resultSet)
Close a given set of database resources.
|
static void |
closeDatabaseResources(PreparedStatement preparedStatement)
Close a given set of database resources.
|
static void |
closeDatabaseResources(PreparedStatement preparedStatement,
ResultSet resultSet)
Close a given set of database resources.
|
static void |
enableAutoCommit(Connection dbConnection)
Enables the auto-commit of a connection.
|
static Map<String,String> |
getHyperParamsAsAMap(List<org.wso2.carbon.ml.commons.domain.config.HyperParameter> hyperParams)
Get the hyper parameters as a map
|
static void |
rollBack(Connection dbConnection)
Roll-backs a connection.
|
static String |
toString(Clob clob)
Get String from Clob
|
public static void closeDatabaseResources(Connection connection, PreparedStatement preparedStatement, ResultSet resultSet) throws DatabaseHandlerException
connection - Connection to be closedpreparedStatement - PeparedStatement to be closedresultSet - ResultSet to be closedDatabaseHandlerExceptionpublic static void closeDatabaseResources(Connection connection, PreparedStatement preparedStatement) throws DatabaseHandlerException
connection - Connection to be closedpreparedStatement - PeparedStatement to be closedDatabaseHandlerExceptionpublic static void closeDatabaseResources(Connection connection) throws DatabaseHandlerException
connection - Connection to be closedDatabaseHandlerExceptionpublic static void closeDatabaseResources(PreparedStatement preparedStatement) throws DatabaseHandlerException
preparedStatement - PeparedStatement to be closedDatabaseHandlerExceptionpublic static void closeDatabaseResources(PreparedStatement preparedStatement, ResultSet resultSet) throws DatabaseHandlerException
preparedStatement - Prepared statement to be closedresultSet - Result set to be closedDatabaseHandlerExceptionpublic static void rollBack(Connection dbConnection) throws DatabaseHandlerException
dbConnection - Connection to be rolled-backDatabaseHandlerExceptionpublic static void enableAutoCommit(Connection dbConnection)
dbConnection - Connection of which the auto-commit should be enabledpublic static Map<String,String> getHyperParamsAsAMap(List<org.wso2.carbon.ml.commons.domain.config.HyperParameter> hyperParams)
hyperParams - A List of HyperParameterpublic static String toString(Clob clob) throws DatabaseHandlerException
clob - Clob objectDatabaseHandlerExceptionCopyright © 2018 WSO2, Inc.. All rights reserved.