|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object biz.chitec.quarterback.util.DBAbstractor
Convenience class with oftenly needed database operations.
Field Summary | |
(package private) static int |
jdbcdriver
|
(package private) static int |
JMS_MYSQL
|
(package private) static int |
MM_MYSQL
|
(package private) static int |
ORACLE
|
Constructor Summary | |
private |
DBAbstractor()
Constructor for the DBAbstractor object |
Method Summary | |
static java.lang.String |
charDate(EDate ed)
EDate conversion for insert and update statements. |
static java.lang.String |
charDate(java.lang.String s)
Deprecated. Use charDate(EDate) instead. |
static java.lang.String |
dayOfYearOf(java.lang.String s)
Description of the Method |
static java.lang.String |
escBinary(java.lang.String s)
Escape everything to make binary data saveable. |
static java.lang.String |
esrp(java.lang.String s)
Description of the Method |
static java.lang.String |
esrq(java.lang.String key,
java.lang.String s)
Description of the Method |
static java.lang.String |
getDefaultValue(java.sql.Statement dbstmt,
java.lang.String table,
java.lang.String field)
|
static EDate |
getEDate(java.sql.ResultSet rs,
int idx)
Reads an EDate out of the given ResultSet at the given index. |
static EDate |
getEDateOrAlternative(java.sql.ResultSet rs,
int idx,
EDate alternative)
Reads an EDate and returns the given alternative if the content is malformatted. |
static EDate |
getEDateOrCopiedAlternative(java.sql.ResultSet rs,
int idx,
EDate alternative)
Reads an EDate and returns an independent copy of the given alternative if the content is malformatted. |
static EDate |
getEDateOrCurrent(java.sql.ResultSet rs,
int idx)
Reads an EDate and returns the current time if the content is malformatted. |
static EDate |
getEDateOrNull(java.sql.ResultSet rs,
int idx)
Reads an EDate and returns null if the content is malformatted. |
static int |
getFirstInt(java.sql.Statement dbstmt,
java.lang.String query)
Returns the first row of the first reply as integer. |
static EDate |
getNow(java.sql.Statement dbstmt)
Returns current time using the database engine. |
static java.lang.String |
hourOf(java.lang.String s)
Description of the Method |
static void |
init(java.lang.String drivername)
Initialisation with drivername so that correct abstraction is chosen. |
static java.lang.String |
makeSortString(java.lang.String s)
Makes a all-lower-case, unspaceified version of the given string. |
static java.lang.String |
minuteOf(java.lang.String s)
Description of the Method |
static java.lang.String |
nowLiteral()
Return a literal which may be used for "now" in SQL clauses |
static void |
putEDate(java.util.Map m,
java.lang.Object key,
java.sql.ResultSet rs,
int idx)
Reads an EDate and stores it into Map (throw NPE or NFE else). |
static void |
putEDateIfAvailable(java.util.Map m,
java.lang.Object key,
java.sql.ResultSet rs,
int idx)
Reads an EDate and stores it into Map if it is available and valid (otherwise nothing is stored). |
static java.lang.String |
secondOf(java.lang.String s)
Description of the Method |
static java.lang.String |
sqlDate(EDate d)
EDate conversion for "where" parts of SQL clauses. |
static java.lang.String |
straightJoin()
Description of the Method |
static java.lang.String |
toUpperCase(java.lang.String s)
Transformation to all upper case with respect to the database handling of special chars |
static boolean |
trueOnZero(java.sql.Statement dbstmt,
java.lang.String query)
Submits the query. |
static java.lang.String |
yearOf(java.lang.String s)
Description of the Method |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
static final int JMS_MYSQL
static final int MM_MYSQL
static final int ORACLE
static int jdbcdriver
Constructor Detail |
private DBAbstractor()
Method Detail |
public static void init(java.lang.String drivername) throws java.sql.SQLException
java.sql.SQLException
public static java.lang.String escBinary(java.lang.String s)
public static java.lang.String makeSortString(java.lang.String s)
public static java.lang.String toUpperCase(java.lang.String s)
public static boolean trueOnZero(java.sql.Statement dbstmt, java.lang.String query) throws java.sql.SQLException
dbstmt
- Statement for communication with the database.query
- Arbitrary "select" query which should return one integer value.
java.sql.SQLException
public static int getFirstInt(java.sql.Statement dbstmt, java.lang.String query) throws java.sql.SQLException
dbstmt
- Statement for communication with the database.query
- Arbitrary "select" query which should return one integer value.
java.sql.SQLException
public static EDate getNow(java.sql.Statement dbstmt) throws java.sql.SQLException
dbstmt
- Statement to use for communication with the database.
java.sql.SQLException
public static EDate getEDate(java.sql.ResultSet rs, int idx) throws java.sql.SQLException
java.sql.SQLException
public static EDate getEDateOrNull(java.sql.ResultSet rs, int idx)
public static EDate getEDateOrCurrent(java.sql.ResultSet rs, int idx)
public static EDate getEDateOrAlternative(java.sql.ResultSet rs, int idx, EDate alternative)
public static EDate getEDateOrCopiedAlternative(java.sql.ResultSet rs, int idx, EDate alternative)
public static void putEDateIfAvailable(java.util.Map m, java.lang.Object key, java.sql.ResultSet rs, int idx)
public static void putEDate(java.util.Map m, java.lang.Object key, java.sql.ResultSet rs, int idx)
public static java.lang.String nowLiteral()
public static java.lang.String sqlDate(EDate d)
d
- EDate to be converted.
public static java.lang.String charDate(java.lang.String s)
public static java.lang.String charDate(EDate ed)
ed
- Date to be converted
public static java.lang.String hourOf(java.lang.String s)
s
- Description of the Parameter
public static java.lang.String minuteOf(java.lang.String s)
s
- Description of the Parameter
public static java.lang.String secondOf(java.lang.String s)
s
- Description of the Parameter
public static java.lang.String yearOf(java.lang.String s)
s
- Description of the Parameter
public static java.lang.String dayOfYearOf(java.lang.String s)
s
- Description of the Parameter
public static java.lang.String esrq(java.lang.String key, java.lang.String s)
key
- Description of the Parameters
- Description of the Parameter
public static java.lang.String esrp(java.lang.String s)
s
- Description of the Parameter
public static java.lang.String straightJoin()
public static java.lang.String getDefaultValue(java.sql.Statement dbstmt, java.lang.String table, java.lang.String field) throws java.sql.SQLException
java.sql.SQLException
|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |