public class DatabaseUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
USER_DB |
Constructor and Description |
---|
DatabaseUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
connect()
Provides a connection to a mySQL database for storing user information and logs.
|
static int |
createUser()
Deprecated.
|
static int |
insert(java.lang.String table,
java.util.Map<java.lang.String,java.lang.String> column_value_map)
Convinience method for multiple String inserts.
|
static java.sql.ResultSet |
query(java.lang.String sql,
java.lang.Object... params)
Generic, sanitized query.
|
static void |
setDBCredentials(java.lang.String dbUrl,
java.lang.String dbSchema,
java.lang.String dbUser,
java.lang.String dbPass) |
static void |
update(java.lang.String sql,
java.lang.Object... params)
Sanitize method for updates (and inserts)
|
public static final java.lang.String USER_DB
public static void connect()
public static java.sql.ResultSet query(java.lang.String sql, java.lang.Object... params)
sql
- params
- public static void update(java.lang.String sql, java.lang.Object... params)
sql
- params
- public static int insert(java.lang.String table, java.util.Map<java.lang.String,java.lang.String> column_value_map) throws java.sql.SQLException
table
- column_value_map
- java.sql.SQLException
@Deprecated public static int createUser()
public static void setDBCredentials(java.lang.String dbUrl, java.lang.String dbSchema, java.lang.String dbUser, java.lang.String dbPass)