public abstract class AbstractDatabase
extends java.lang.Object
Constructor and Description |
---|
AbstractDatabase() |
Modifier and Type | Method and Description |
---|---|
static java.lang.Object |
createObject(java.lang.String className)
Instantiate a class using the name of the class at runtime
|
abstract java.lang.String |
getDateTimeFunction()
The function name that gets the current date and time
from the database server
|
abstract java.lang.String |
getIsNULLFunction()
The function name that is used to return non-NULL value
|
abstract java.lang.String |
getLeftJoinQuery(java.lang.String selectFields,
java.lang.String tableA,
java.lang.String tableB,
java.lang.String joinCriteria,
java.lang.String nonJoinCriteria)
Syntax for doing a left join
Add 'a.' in front of the fields for first table and
'b.' in front of the fields for the second table
|
abstract java.lang.String |
getPagedQuery(java.lang.String queryWithOrderBy,
java.lang.Integer start,
java.lang.Integer count)
for generating a query for paging
|
abstract java.lang.String |
getReplicationDocumentListSQL()
This method will return the sql command to get document list in xml_document
in replication.
|
abstract java.lang.String |
getStringDelimiter()
The character that the specific database implementation uses to
indicate string literals in SQL.
|
abstract long |
getUniqueID(java.sql.Connection conn,
java.lang.String tableName)
Unique ID generator
|
static void |
main(java.lang.String[] args)
the main routine used to test the dbadapter utility.
|
java.lang.String |
toDate(java.lang.String dateString,
java.lang.String format)
MSSQL didn't support to_date function which to transfer a text string
to date type.
|
public abstract long getUniqueID(java.sql.Connection conn, java.lang.String tableName) throws java.sql.SQLException
conn
- db connection in which the unique id was generatedtableName
- the table which unique id was generatejava.sql.SQLException
- public abstract java.lang.String getDateTimeFunction()
public abstract java.lang.String getIsNULLFunction()
public abstract java.lang.String getStringDelimiter()
public java.lang.String toDate(java.lang.String dateString, java.lang.String format)
public abstract java.lang.String getLeftJoinQuery(java.lang.String selectFields, java.lang.String tableA, java.lang.String tableB, java.lang.String joinCriteria, java.lang.String nonJoinCriteria)
selectFields
- fields that you want to be selectedtableA
- first table in the jointableB
- second table in the joinjoinCriteria
- the criteria based on which the join will be madenonJoinCriteria
- all other criteriaspublic static java.lang.Object createObject(java.lang.String className) throws java.lang.Exception
className
- the fully qualified name of the class to instantiatejava.lang.Exception
public static void main(java.lang.String[] args)
public abstract java.lang.String getReplicationDocumentListSQL()
public abstract java.lang.String getPagedQuery(java.lang.String queryWithOrderBy, java.lang.Integer start, java.lang.Integer count)
queryWithOrderBy
- - the complete query with SELECT, FROM, WHERE and ORDER BY clausesstart
- the row number to start fromcount
- the number of records from start to returnCopyright © 2020 Regents of the University of California. All Rights Reserved.