public class DbConn
extends java.lang.Object
Constructor and Description |
---|
DbConn(int bugs,
java.lang.String dbUrl) |
Modifier and Type | Method and Description |
---|---|
void |
closeDb() |
static java.lang.String |
dbstring(double vv) |
static java.lang.String |
dbstring(int vv) |
static java.lang.String |
dbstring(long vv) |
static java.lang.String |
dbstring(java.lang.String stg) |
static java.lang.String |
dbstring(java.sql.Timestamp ts) |
static java.lang.String |
dbstringcom(double vv) |
static java.lang.String |
dbstringcom(int vv) |
static java.lang.String |
dbstringcom(long vv) |
static java.lang.String |
dbstringcom(java.lang.String stg) |
static java.lang.String |
dbstringcom(java.sql.Timestamp ts) |
static java.lang.String |
dbstringforce(java.lang.String stg) |
static java.lang.String |
dbstringforcecom(java.lang.String stg) |
static java.lang.String |
dbstringsub(java.lang.String stg,
boolean forceit)
Creates a string suitable for MySQL commands,
including escaped quotes and the surrounding single quotes.
|
java.lang.String |
getDbString(java.lang.String sqlstg)
Retrieves a single String from the DB.
|
java.lang.Object[][] |
getDbTable(java.lang.String sqlstg,
java.lang.String[] types,
boolean allownull)
Retrieves a table from the DB:
each array row represents one DB row,
and each array column represents a DB column.
|
void |
updateDb(java.lang.String sqlstg)
Updates the DB.
|
public DbConn(int bugs, java.lang.String dbUrl) throws MmdException
MmdException
public void closeDb() throws MmdException
MmdException
public java.lang.String getDbString(java.lang.String sqlstg) throws MmdException
sqlstg
- The SQL string used to query the DB.MmdException
public void updateDb(java.lang.String sqlstg) throws MmdException
sqlstg
- The SQL string to be used.MmdException
public java.lang.Object[][] getDbTable(java.lang.String sqlstg, java.lang.String[] types, boolean allownull) throws MmdException
sqlstg
- The SQL string used to query the DB.types
- An array of the types of the returned columns.
Valid values are:
Specified type | Returned java type |
---|---|
"boolean" | Boolean |
"date" | Long (milliseconds since 1970) |
"double" | Double |
"int" | Integer |
"long" | Long |
"string" | String |
MmdException
public static java.lang.String dbstringcom(java.sql.Timestamp ts) throws MmdException
MmdException
public static java.lang.String dbstring(java.sql.Timestamp ts) throws MmdException
MmdException
public static java.lang.String dbstringcom(double vv) throws MmdException
MmdException
public static java.lang.String dbstring(double vv) throws MmdException
MmdException
public static java.lang.String dbstringcom(int vv) throws MmdException
MmdException
public static java.lang.String dbstring(int vv) throws MmdException
MmdException
public static java.lang.String dbstringcom(long vv) throws MmdException
MmdException
public static java.lang.String dbstring(long vv) throws MmdException
MmdException
public static java.lang.String dbstringcom(java.lang.String stg) throws MmdException
MmdException
public static java.lang.String dbstring(java.lang.String stg) throws MmdException
MmdException
public static java.lang.String dbstringforce(java.lang.String stg) throws MmdException
MmdException
public static java.lang.String dbstringforcecom(java.lang.String stg) throws MmdException
MmdException
public static java.lang.String dbstringsub(java.lang.String stg, boolean forceit) throws MmdException
MmdException