com.isti.util.database
Class BasicDatabase

java.lang.Object
  extended by com.isti.util.database.AbstractDatabase
      extended by com.isti.util.database.BasicDatabase

public class BasicDatabase
extends AbstractDatabase


Field Summary
static java.lang.String[] EMPTY_COLUMN_NAMES
          The column names to use in query for all columns.
 
Fields inherited from class com.isti.util.database.AbstractDatabase
EMPTY_TEXT
 
Constructor Summary
BasicDatabase(ConnectionJDBC dbConn)
          Creates a connection to a basic database.
 
Method Summary
 java.lang.String[] getColumnNames()
          Gets the column names to use in query Subclasses that need a subset of columns should override this method.
 int getColumnOrderNumcolumns()
          Gets the number of columns to use for ordering Subclasses that want to use a subset of the order columns should override this method.
 java.lang.String getFromClause(java.lang.String text)
          Gets the from clause
 java.lang.String getOrderByClause(java.lang.String text)
          Gets the order by clause
 java.lang.String getSelectClause(java.lang.String text)
          Gets the select clause
 java.lang.String getString(int index)
          Gets a string representation of a database element.
 java.lang.String getTableName()
          Gets the table name.
 java.lang.String getTablePrefix()
          Gets the table prefix Subclasses that need a table prefix should override this method.
 java.lang.String getTitle(int index)
          Gets a title string representation of a database element.
 
Methods inherited from class com.isti.util.database.AbstractDatabase
closeDatabaseConnection, executeQuery, getColumnObjects, getColumnPrefix, getDatabaseConnection, getDatabaseQuery, getDateFormatter, getDateFormatter, getMap, getTimeFormatter, setDatabaseQuery, setDateFormatter, setTimeFormatter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_COLUMN_NAMES

public static final java.lang.String[] EMPTY_COLUMN_NAMES
The column names to use in query for all columns.

Constructor Detail

BasicDatabase

public BasicDatabase(ConnectionJDBC dbConn)
Creates a connection to a basic database.

Parameters:
dbConn - database connection
Method Detail

getTableName

public java.lang.String getTableName()
Gets the table name. It is recommended that all subclasses override this method.

Specified by:
getTableName in class AbstractDatabase
Returns:
the table name.

getTablePrefix

public java.lang.String getTablePrefix()
Gets the table prefix Subclasses that need a table prefix should override this method.

Specified by:
getTablePrefix in class AbstractDatabase
Returns:
the table prefix

getColumnNames

public java.lang.String[] getColumnNames()
Gets the column names to use in query Subclasses that need a subset of columns should override this method.

Specified by:
getColumnNames in class AbstractDatabase
Returns:
the column names to use in query or empty for all
See Also:
getColumnOrderNames, getColumnOrderNumcolumns

getColumnOrderNumcolumns

public int getColumnOrderNumcolumns()
Gets the number of columns to use for ordering Subclasses that want to use a subset of the order columns should override this method.

Specified by:
getColumnOrderNumcolumns in class AbstractDatabase
Returns:
the number of columns to use for ordering
See Also:
getColumnNames, getColumnOrderNames

getSelectClause

public java.lang.String getSelectClause(java.lang.String text)
Gets the select clause

Specified by:
getSelectClause in class AbstractDatabase
Parameters:
text - select text
Returns:
the select clause

getFromClause

public java.lang.String getFromClause(java.lang.String text)
Gets the from clause

Specified by:
getFromClause in class AbstractDatabase
Parameters:
text - from text
Returns:
the from clause

getOrderByClause

public java.lang.String getOrderByClause(java.lang.String text)
Gets the order by clause

Specified by:
getOrderByClause in class AbstractDatabase
Parameters:
text - order by text
Returns:
the order by clause

getString

public java.lang.String getString(int index)
Gets a string representation of a database element.

Specified by:
getString in class AbstractDatabase
Parameters:
index - database element index
Returns:
a string representation of a database element.

getTitle

public java.lang.String getTitle(int index)
Gets a title string representation of a database element.

Specified by:
getTitle in class AbstractDatabase
Parameters:
index - database element index
Returns:
a title string representation of a database element.