public class DatabaseUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ORDER_ENTRY_UPGRADE_SETTINGS_FILENAME
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. |
Constructor and Description |
---|
DatabaseUtil() |
Modifier and Type | Method and Description |
---|---|
static java.util.List<java.util.List<java.lang.Object>> |
executeSQL(java.sql.Connection conn,
java.lang.String sql,
boolean selectOnly)
Executes the passed SQL query, enforcing select only if that parameter is set
|
static <T> java.util.Set<T> |
getUniqueNonNullColumnValues(java.lang.String columnName,
java.lang.String tableName,
java.lang.Class<T> type,
java.sql.Connection connection)
Gets all unique values excluding nulls in the specified column and table
|
static void |
loadDatabaseDriver(java.lang.String connectionUrl)
Deprecated.
|
static java.lang.String |
loadDatabaseDriver(java.lang.String connectionUrl,
java.lang.String connectionDriver) |
public static final java.lang.String ORDER_ENTRY_UPGRADE_SETTINGS_FILENAME
@Deprecated public static void loadDatabaseDriver(java.lang.String connectionUrl) throws java.lang.ClassNotFoundException
connectionUrl
- the connection url for the database, such as
"jdbc:mysql://localhost:3306/..."java.lang.ClassNotFoundException
public static java.lang.String loadDatabaseDriver(java.lang.String connectionUrl, java.lang.String connectionDriver) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
public static java.util.List<java.util.List<java.lang.Object>> executeSQL(java.sql.Connection conn, java.lang.String sql, boolean selectOnly) throws DAOException
DAOException
public static <T> java.util.Set<T> getUniqueNonNullColumnValues(java.lang.String columnName, java.lang.String tableName, java.lang.Class<T> type, java.sql.Connection connection) throws java.lang.Exception
columnName
- the columntableName
- the tableconnection
- java.lang.Exception
Copyright © 2018 OpenMRS Inc.. All Rights Reserved.