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 closedDatabaseHandlerException
public static void closeDatabaseResources(Connection connection, PreparedStatement preparedStatement) throws DatabaseHandlerException
connection
- Connection to be closedpreparedStatement
- PeparedStatement to be closedDatabaseHandlerException
public static void closeDatabaseResources(Connection connection) throws DatabaseHandlerException
connection
- Connection to be closedDatabaseHandlerException
public static void closeDatabaseResources(PreparedStatement preparedStatement) throws DatabaseHandlerException
preparedStatement
- PeparedStatement to be closedDatabaseHandlerException
public static void closeDatabaseResources(PreparedStatement preparedStatement, ResultSet resultSet) throws DatabaseHandlerException
preparedStatement
- Prepared statement to be closedresultSet
- Result set to be closedDatabaseHandlerException
public static void rollBack(Connection dbConnection) throws DatabaseHandlerException
dbConnection
- Connection to be rolled-backDatabaseHandlerException
public 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 HyperParameter
public static String toString(Clob clob) throws DatabaseHandlerException
clob
- Clob
objectDatabaseHandlerException
Copyright © 2016 WSO2, Inc.. All Rights Reserved.