public class DatabaseUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ORDER_ENTRY_UPGRADE_SETTINGS_FILENAME |
Modifier and Type | Method and Description |
---|---|
static List<List<Object>> |
executeSQL(Connection conn,
String sql,
boolean selectOnly)
Executes the passed SQL query, enforcing select only if that parameter is set for given Connection
|
static List<List<Object>> |
executeSQL(org.hibernate.Session session,
String sql,
boolean selectOnly)
Executes the passed SQL query, enforcing select only if that parameter is set for given Session
|
static <T> Set<T> |
getUniqueNonNullColumnValues(String columnName,
String tableName,
Class<T> type,
Connection connection)
Gets all unique values excluding nulls in the specified column and table
|
static String |
loadDatabaseDriver(String connectionUrl,
String connectionDriver)
Executes the passed SQL query, enforcing select only if that parameter is set Load the jdbc
driver class for the database which is specified by the connectionUrl and connectionDriver
parameters
This is only needed when loading up a jdbc connection manually for the first time. |
public static final String ORDER_ENTRY_UPGRADE_SETTINGS_FILENAME
public static String loadDatabaseDriver(String connectionUrl, String connectionDriver) throws ClassNotFoundException
connectionUrl
- the connection url for the database, such as
"jdbc:mysql://localhost:3306/..."connectionDriver
- the database driver class name, such as "com.mysql.cj.jdbc.Driver"ClassNotFoundException
public static List<List<Object>> executeSQL(org.hibernate.Session session, String sql, boolean selectOnly) throws DAOException
DAOException
public static List<List<Object>> executeSQL(Connection conn, String sql, boolean selectOnly) throws DAOException
DAOException
public static <T> Set<T> getUniqueNonNullColumnValues(String columnName, String tableName, Class<T> type, Connection connection) throws Exception
columnName
- the columntableName
- the tableconnection
- Exception
Copyright © 2024 OpenMRS Inc.. All rights reserved.