www.element4solution.com

e4s.db
Class E4DBSelect

java.lang.Object
  extended by e4s.util.E4Object
      extended by e4s.db.E4DBFilter
          extended by e4s.db.E4DBFilterAnd
              extended by e4s.db.E4DBSelect
All Implemented Interfaces:
E4DBFilter_Intf, E4DBFilterAnd_Intf
Direct Known Subclasses:
E4DBSelectDict, E4DBSelectFreefields, E4DBSelectView, T_E4S_CLIENT_Sel, T_E4S_CLIENT_VAL_Sel, T_E4S_FREEFIELD_DEF_Sel, T_E4S_FREEFIELD_VAL_Sel, T_E4S_HINT_READ_Sel, T_E4S_HINT_Sel, T_E4S_LOGIN_HISTORY_Sel, T_E4S_MAIL_SENT_Sel, T_E4S_OVERVIEW_Sel, T_E4S_PERMISSION_COMPANY_Sel, T_E4S_PERMISSION_GROUP_Sel, T_E4S_PERMISSION_USER_Sel, T_E4S_QUERY_CLIENTS_Sel, T_E4S_QUERY_PARAMS_Sel, T_E4S_QUERY_Sel, T_E4S_TRANS_APP_Sel, T_E4S_TRANS_DATA_Sel, T_E4S_TRANS_SYS_Sel, T_E4S_USER_VAL_Sel

public class E4DBSelect
extends E4DBFilterAnd

This is the base class for selecting database records (SQL-select) where all the generated classes by the dictionary are inheritated from. This is a very generic implementation, it covers the JDBC objects Statement and ResultSet. We think, that the core JDBC implementation has the disadvantage, that you need to know the names of the tables and their columns at compiletime, and there is no regular mechanism to ensure consisteny. To avoid inconsistent programs (database scheme is different from the code), there is a table generation mechanism built into the e4s. This mechanism is based on an interactive datadictionary (@link e4s.application.sysmodules.dict.moduleDictionaryTables} which uses E4DBTable and other related classes to hold data dictionary information and to generate the classes. This leads to a more current implementation of classes (not part of the library as they become generated). Those classes are inheritated from this class and they can be used to retrieve or modify data based on member functions that represent the current column names. There is also an implementation (for selection only) which can be found in E4DBSelectDict which is somewhere in the middle: not using static generated classes but using dynamic content of the E4DBTable class at runtime.

Since:
JDK 1.4
See Also:
E4DBModify, E4DBSelect_Intf, E4DBSelectDict, E4DBSelectFreefields

Field Summary
static E4DBColumnName COLUMN_NAME_COUNT
          Column name for counting queries.
static E4DBColumnName COLUMN_NAME_SUM
          Column name for summarizing queries.
static java.text.SimpleDateFormat DB_DATEFORMAT
          The date picture for the database internal representation of java.util.Date values.
static java.lang.String DB_DATEPICTURE
          The date picture for the database internal representation of java.util.Date values.
protected static boolean ms_isunicode
           
static java.lang.String NULL
           
 
Fields inherited from class e4s.db.E4DBFilter
COMP_EMPTY, COMP_EQUALS, COMP_GREATER, COMP_GREATER_EQUAL, COMP_IN, COMP_IS_NOT_NULL, COMP_IS_NULL, COMP_LESS, COMP_LESS_EQUAL, COMP_LIKE, COMP_NOT_EMPTY, COMP_NOT_EQUALS, COMP_NOT_IN, COMP_NOT_LIKE
 
Fields inherited from class e4s.util.E4Object
CRLF, E4S_CORE_SYSTEM_LANGUAGE, NBSP, NULLSTR, URL_ENCODING_CHARSET
 
Constructor Summary
E4DBSelect()
          The empty constructor is intended if you like to use the #executeQuery(String) function directly.
E4DBSelect(E4DBConnection_Intf con)
          The empty constructor is intended if you like to use the #executeQuery(String) function directly.
E4DBSelect(E4DBConnection_Intf con, E4DBTableName tableName)
          Construct an object for selecting data from a table, using the specified database connection.
E4DBSelect(E4DBConnection_Intf con, E4DBTableName tableName, E4ApplObj_Intf applobj)
          Construct an object for selecting data from a table, using the specified database connection, the table uses client distinction.
E4DBSelect(E4DBSelect_Intf select, boolean copy_where)
           
E4DBSelect(E4DBSelect select, boolean copy_where)
           
E4DBSelect(E4DBTableName tableName)
          Construct an object for selecting data from a table, using the default database connection.
E4DBSelect(E4DBTableName tableName, E4ApplObj_Intf applobj)
          Construct an object for selecting data from a table, using the default database connection, the table uses client distinction.
 
Method Summary
static java.lang.String _getSVNVersionString()
          Get version info string from subversion.
static boolean checkConsistencyIndex(E4DBConnection_Intf con, E4DBTableName tablename, E4DBIndexInfo[] metaschema, boolean make_correction_indexes)
           
static boolean checkConsistencyIndex(E4DBTableName tablename, E4DBIndexInfo[] metaschema)
           
static boolean checkConsistencyTable(E4DBConnection_Intf con, E4DBTableName tablename, boolean is_client_distinctive, E4DBColumnInfo[] columns)
           
static boolean checkConsistencyTable(E4DBConnection_Intf con, E4DBTableName tablename, boolean is_client_distinctive, E4DBColumnInfo[] columns, boolean make_correction_table)
           
static boolean checkConsistencyTable(E4DBTableName tablename, boolean is_client_distinctive, E4DBColumnInfo[] columns)
          remove this public static boolean checkConsistency( E4DBTableName tablename, boolean dummy, E4DBColumnType columns[] ) { return false; }
 void close()
          Close the database connection (if pooling is enabled #e4s.db.E4DBConnection_Intf#connectionIsPooled).
protected  void data2csv(E4PrintStream out, boolean data)
           
protected  void data2csv(E4PrintStream out, java.util.Date data)
           
protected  void data2csv(E4PrintStream out, E4Long data)
           
protected  void data2csv(E4PrintStream out, E4String data)
           
protected  void data2csv(E4PrintStream out, float data)
           
protected  void data2csv(E4PrintStream out, long data)
           
protected  void data2csv(E4PrintStream out, java.lang.String data)
           
protected  void data2csvHeader(E4PrintStream out, E4DBColumnInfo cinfo)
           
protected  void data2csvHeader(E4PrintStream out, E4DBColumnInfo[] cinfo)
           
 void disableLogging()
          Disables logging explicit - overrides E4DBLogging default settings based on general .ini settings.
 void enableLogging()
          Enables logging explicit - overrides E4DBLogging default settings based on general .ini settings.
static void enableUnicode(boolean unicode)
           
 long executeCount()
           
 void executeCountQuery()
          Perform a sql that counts the records.
 void executeCountQuery(E4DBColumnName groupfield)
          Perform a sql that counts the records, grouped by a specified column.
 void executeCountQuery(E4DBColumnName[] groupfields)
          Perform a sql that counts the records, grouped by a specified column.
 void executeDistinctQuery(E4DBColumnName column)
           
 void executeDistinctQuery(E4DBColumnName[] columns)
           
 long executeMax(E4DBColumnName fieldname)
          Execute a SELECT MAX(fieldname) FROM statement and return the maximum value.
 java.util.Date executeMaxDate(E4DBColumnName fieldname)
           
 java.lang.String executeMaxString(E4DBColumnName fieldname)
          Execute a SELECT MAX(fieldname) FROM statement and return the maximum value.
 long executeMin(E4DBColumnName fieldname)
          Execute a SELECT MIN(fieldname) FROM statement and return the minimum value.
 java.util.Date executeMinDate(E4DBColumnName fieldname)
           
 java.lang.String executeMinString(E4DBColumnName fieldname)
          Execute a SELECT MAX(fieldname) FROM statement and return the maximum value.
 void executeQuery()
          Execute the query by building an SQL string out of the where and sort definitions.
 void executeQuery(int top)
          Execute a query by fetching the specified topmost records only (SELECT TOP ..
 void executeQuery(java.lang.String sql, E4ApplObj_Intf applobj)
          Exceptional case: execute a query by ignoring all where and sort definitions, just using the string specified.
static java.sql.ResultSet executeSQL(E4ApplObj_Intf appobj, java.lang.String sql)
           
static java.sql.ResultSet executeSQL(E4DBConnection_Intf con, E4ApplObj_Intf appobj, java.lang.String sql)
           
static java.sql.ResultSet executeSQL(E4DBConnection_Intf con, java.lang.String sql)
           
 void executeSumQuery(E4DBColumnName sumfield)
          Perform a sql that summarizes the records.
 void executeSumQuery(E4DBColumnName sumfield, E4DBColumnName groupfield)
          Perform a sql that summarizes the records, grouped by a specified column.
 void executeSumQuery(E4DBColumnName sumfield, E4DBColumnName[] groupfields)
          Perform a sql that summarizes the records, grouped by a specified column.
 void finalize()
           
 boolean getBoolean(E4DBColumnName fieldName)
           
 E4DBConnection_Intf getConnection()
          Get the database connection.
 java.util.Date getDate(E4DBColumnName fieldName)
           
 java.lang.String[] getDistinctData(E4DBColumnName column)
          Based on the opened database query object ("this"), a SELECT DICTINCT column will be performed.
 double getDouble(E4DBColumnName fieldName)
           
 E4Long getE4Long(E4DBColumnName fieldName)
           
 E4String getE4String(E4DBColumnName fieldName)
           
 E4DBIndexInfo getFirstPrimaryIndex()
          Get the fields defined in the first unique index, return null if not available.
 float getFloat(E4DBColumnName fieldName)
           
 int getInt(E4DBColumnName fieldName)
           
 long getLong(E4DBColumnName fieldName)
           
 E4DBResultSetMetaData getMetaData()
           
 E4DBReference[] getReferenceDelete(E4DBColumnName dummy)
          Return null.
 E4DBReference[] getReferenceLookup(E4DBColumnName dummy)
          Return null.
 java.sql.ResultSet getResultSet()
          Get the underlying JDBC ResultSet.
 E4DBStatement getStatement()
          Get the underlying JDBC Statement.
 java.lang.String getString(E4DBColumnName fieldName)
           
 E4DBTableName getTableName()
          Get the table name.
 boolean isLogging()
          Get the logging state of this E4DBSelect.
 boolean isTable()
          Is this data access object a table?
static boolean isUnicodeEnabled()
          Determine, if UNICODE is enabled.
 boolean isView()
          Is this data access object a view?
 boolean next()
          Fetch next record.
protected static E4DBTypeUsage[] removeOwnTableColumn(E4DBTypeUsage[] defs, E4DBTableName table, E4DBColumnName column)
           
 void reset()
           
 void resetOrderBy()
           
 void setConnection(E4DBConnection_Intf con)
          Sets the database connection.
 void setFilterQuery(E4DBColumnInfo col, E4String values)
          Depending on the type of field (String, long, ..) this function will analyze the specified values String, which can contain more than one value.
 void setFilterQuery(E4DBColumnInfo col, java.lang.String values)
          Depending on the type of field (String, long, ..) this function will analyze the specified values String, which can contain more than one value.
 void setOrderBy(E4DBColumnName column)
           
 void setOrderBy(E4DBColumnName column, boolean descending)
           
 void setOrderExtended(java.lang.String orderstring, boolean descending)
          Set an individual expression for the sortorder.
 boolean supportsSorting()
           
static java.util.Date toDate(java.lang.String dStr)
          Convert a string to a date, using the date-picture format.
 java.lang.String toString()
          Last SQL statement executed.
static java.lang.String toString(java.util.Date dat)
          Convert a date to a string, using the date-picture format.
 
Methods inherited from class e4s.db.E4DBFilterAnd
getWhere, isEmpty, isNotEmpty, isNotNull, isNull, OR, setFilter_NOT, setFilter_NOT, setFilter_NOT, setFilter_NOT, setFilter, setFilter, setFilter, setFilter, setFilter, setFilter, setFilter, setFilter, setFilter, setFilter, setFilter, setFilter, setFilter, setFilter, setFilter, setFilter, setFilter, setFilter, setFilter, setFilter, setFilter, setFilter, setFilter, setFilter, setFilter, setFilter
 
Methods inherited from class e4s.db.E4DBFilter
Escape, Escape, getApplObj, getClient, getSession, getWhere, isWhereDefined, OP, resetWhere, setFilter_IN, setFilter_IN, setFilter_IN, setFilter_IN, setFilter_IN, setFilter_NOT_IN, setFilter_NOT_IN, setFilter_NOT_IN, setFilter_NOT_IN, setFilter_NOT_IN, setFilter, setFilter, setWhere, toString
 
Methods inherited from class e4s.util.E4Object
Calendar, CName, CName, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelSys, E4LabelSys, e4sCopyright, e4sVersion, encode, encode, encode, encodeHtml, encodeHtml, encodeHtml, encodeURL, encodeURL, encodeURL, getLINE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTraceMemory, HtmlEncode, HtmlEncode, HtmlEncode, isdecimal, isdigit, isnotok, isnotok, isnumeric, isok, isok, isok, isok, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingStack, mkdirs, null2nbsp, null2nbsp, null2nbsp, ok, ok, ok, ok, outPrintln, setLogFile4Trace, setTraceMemory, STACKTRACE, toDebug, toDouble, toFloat, toFloat, TRACE_CALLS, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, wait
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface e4s.db.E4DBFilter_Intf
isWhereDefined, resetWhere
 

Field Detail

ms_isunicode

protected static boolean ms_isunicode

DB_DATEPICTURE

public static final java.lang.String DB_DATEPICTURE
The date picture for the database internal representation of java.util.Date values.

See Also:
DB_DATEFORMAT, Constant Field Values

DB_DATEFORMAT

public static final java.text.SimpleDateFormat DB_DATEFORMAT
The date picture for the database internal representation of java.util.Date values.

See Also:
DB_DATEPICTURE

NULL

public static java.lang.String NULL

COLUMN_NAME_COUNT

public static E4DBColumnName COLUMN_NAME_COUNT
Column name for counting queries.

See Also:
executeCountQuery()

COLUMN_NAME_SUM

public static E4DBColumnName COLUMN_NAME_SUM
Column name for summarizing queries.

See Also:
executeSumQuery(e4s.db.E4DBColumnName)
Constructor Detail

E4DBSelect

public E4DBSelect(E4DBTableName tableName)
           throws E4DBException
Construct an object for selecting data from a table, using the default database connection. No client distinction on this table.

Parameters:
tableName - the name of a database table
Throws:
E4DBException

E4DBSelect

public E4DBSelect()
           throws E4DBException
The empty constructor is intended if you like to use the #executeQuery(String) function directly. By that, you may not use filters or sorting.

Throws:
E4DBException
See Also:
#executeQuery(String)

E4DBSelect

public E4DBSelect(E4DBConnection_Intf con)
           throws E4DBException
The empty constructor is intended if you like to use the #executeQuery(String) function directly. By that, you may not use filters or sorting.

Throws:
E4DBException
See Also:
#executeQuery(String)

E4DBSelect

public E4DBSelect(E4DBSelect select,
                  boolean copy_where)
           throws E4DBException
Throws:
E4DBException

E4DBSelect

public E4DBSelect(E4DBSelect_Intf select,
                  boolean copy_where)
           throws E4DBException
Throws:
E4DBException

E4DBSelect

public E4DBSelect(E4DBConnection_Intf con,
                  E4DBTableName tableName)
Construct an object for selecting data from a table, using the specified database connection. No client distinction on this table.

Parameters:
con - the connection
tableName - the name of a database table

E4DBSelect

public E4DBSelect(E4DBTableName tableName,
                  E4ApplObj_Intf applobj)
           throws E4DBException
Construct an object for selecting data from a table, using the default database connection, the table uses client distinction.

Parameters:
tableName - the name of a database table
applobj - an application object, containing client and other information
Throws:
E4DBException
See Also:
E4ModuleImplementation.getApplObj(), E4ServletImplementation_Intf.getApplObj()

E4DBSelect

public E4DBSelect(E4DBConnection_Intf con,
                  E4DBTableName tableName,
                  E4ApplObj_Intf applobj)
Construct an object for selecting data from a table, using the specified database connection, the table uses client distinction.

Parameters:
con - the connection
tableName - the name of a database table
applobj - an application object, containing client and other information
See Also:
E4ModuleImplementation.getApplObj(), E4ServletImplementation_Intf.getApplObj()
Method Detail

executeQuery

public void executeQuery(java.lang.String sql,
                         E4ApplObj_Intf applobj)
                  throws E4DBException
Exceptional case: execute a query by ignoring all where and sort definitions, just using the string specified. This is an exceptional case because normally you should use because of type- and namesafety.

Parameters:
sql - a SQL string for selection, must start with "SELECT" and has the form.
Throws:
E4DBException
See Also:
executeQuery(), executeQuery(int)

executeQuery

public void executeQuery()
                  throws E4DBException
Execute the query by building an SQL string out of the where and sort definitions. Once the query is executed, records can be fetched using the next() function. If the next() function is executed before the executeQuery() was called it will be implicitly involved.

Throws:
E4DBException
See Also:
next(), executeQuery(int), #executeQuery(String)

executeQuery

public void executeQuery(int top)
                  throws E4DBException
Execute a query by fetching the specified topmost records only (SELECT TOP .. FROM ..). Please note, that this is not compatible with all databases and would in that case select even more records than specified here.

Parameters:
top - the number of records to select
Throws:
E4DBException
See Also:
executeQuery(), #executeQuery(String)

executeCount

public long executeCount()
                  throws E4DBException
Throws:
E4DBException

executeMaxString

public java.lang.String executeMaxString(E4DBColumnName fieldname)
                                  throws E4DBException
Execute a SELECT MAX(fieldname) FROM statement and return the maximum value.

Returns:
the maximum String if found or null
Throws:
E4DBException
See Also:
executeMaxDate(e4s.db.E4DBColumnName), executeMinString(e4s.db.E4DBColumnName)

executeMax

public long executeMax(E4DBColumnName fieldname)
                throws E4DBException
Execute a SELECT MAX(fieldname) FROM statement and return the maximum value.

Returns:
Long.MIN_VALUE if no records found
Throws:
E4DBException
See Also:
executeMin(e4s.db.E4DBColumnName), executeMaxString(e4s.db.E4DBColumnName), executeMaxDate(e4s.db.E4DBColumnName)

executeMaxDate

public java.util.Date executeMaxDate(E4DBColumnName fieldname)
                              throws E4DBException
Throws:
E4DBException

executeMinDate

public java.util.Date executeMinDate(E4DBColumnName fieldname)
                              throws E4DBException
Throws:
E4DBException

executeMinString

public java.lang.String executeMinString(E4DBColumnName fieldname)
                                  throws E4DBException
Execute a SELECT MAX(fieldname) FROM statement and return the maximum value.

Returns:
the maximum String if found or null
Throws:
E4DBException
See Also:
executeMin(e4s.db.E4DBColumnName), executeMinDate(e4s.db.E4DBColumnName), executeMaxString(e4s.db.E4DBColumnName)

executeMin

public long executeMin(E4DBColumnName fieldname)
                throws E4DBException
Execute a SELECT MIN(fieldname) FROM statement and return the minimum value.

Returns:
Long.MAX_VALUE if no records found
Throws:
E4DBException
See Also:
executeMax(e4s.db.E4DBColumnName), executeMinString(e4s.db.E4DBColumnName), executeMinDate(e4s.db.E4DBColumnName)

executeCountQuery

public void executeCountQuery()
                       throws E4DBException
Perform a sql that counts the records. The result is sorted by descending by the number of the occurence (as long as no other sort criteria is specified). The specified column as well as COLUMN_NAME_COUNT are columns that can be queried using the getLong(e4s.db.E4DBColumnName) or other functions suited to the format of the group field.

Throws:
E4DBException
See Also:
COLUMN_NAME_COUNT, executeCountQuery( e4s.db.E4DBColumnName ), executeCountQuery( e4s.db.E4DBColumnName[] )

executeCountQuery

public void executeCountQuery(E4DBColumnName groupfield)
                       throws E4DBException
Perform a sql that counts the records, grouped by a specified column. The result is sorted by descending by the number of the occurence (as long as no other sort criteria is specified). The specified column as well as COLUMN_NAME_COUNT are columns that can be queried using the getLong(e4s.db.E4DBColumnName) or other functions suited to the format of the group field.

Parameters:
groupfield - the field which is used by grouping
Throws:
E4DBException
See Also:
COLUMN_NAME_COUNT, executeCountQuery( e4s.db.E4DBColumnName ), executeCountQuery( e4s.db.E4DBColumnName[] )

executeCountQuery

public void executeCountQuery(E4DBColumnName[] groupfields)
                       throws E4DBException
Perform a sql that counts the records, grouped by a specified column. The result is sorted by descending by the number of the occurence (as long as no other sort criteria is specified). The specified column as well as COLUMN_NAME_COUNT are columns that can be queried using the getLong(e4s.db.E4DBColumnName) or other functions suited to the format of the group field.

Parameters:
groupfields - the fields which is used by grouping
Throws:
E4DBException
See Also:
COLUMN_NAME_COUNT, executeCountQuery( e4s.db.E4DBColumnName ), executeCountQuery()

executeSumQuery

public void executeSumQuery(E4DBColumnName sumfield)
                     throws E4DBException
Perform a sql that summarizes the records. The result is un sorted. The COLUMN_NAME_SUM are columns that can be queried using the getLong(e4s.db.E4DBColumnName).

Parameters:
sumfield - the field which is used for summarizing
Throws:
E4DBException
See Also:
COLUMN_NAME_SUM, executeSumQuery( e4s.db.E4DBColumnName ), executeSumQuery( e4s.db.E4DBColumnName, e4s.db.E4DBColumnName[] )

executeSumQuery

public void executeSumQuery(E4DBColumnName sumfield,
                            E4DBColumnName groupfield)
                     throws E4DBException
Perform a sql that summarizes the records, grouped by a specified column. The result is un sorted. The specified column as well as COLUMN_NAME_SUM are columns that can be queried using the getLong(e4s.db.E4DBColumnName).

Parameters:
sumfield - the field which is used for summarizing
groupfield - the fields which is used by grouping
Throws:
E4DBException
See Also:
COLUMN_NAME_SUM, executeSumQuery( e4s.db.E4DBColumnName ), executeSumQuery( e4s.db.E4DBColumnName, e4s.db.E4DBColumnName[] )

executeSumQuery

public void executeSumQuery(E4DBColumnName sumfield,
                            E4DBColumnName[] groupfields)
                     throws E4DBException
Perform a sql that summarizes the records, grouped by a specified column. The result is un sorted. The specified column as well as COLUMN_NAME_SUM are columns that can be queried using the getLong(e4s.db.E4DBColumnName).

Parameters:
sumfield - the field which is used for summarizing
groupfields - the fields which is used by grouping
Throws:
E4DBException
See Also:
COLUMN_NAME_SUM, executeSumQuery( e4s.db.E4DBColumnName ), executeSumQuery( e4s.db.E4DBColumnName, e4s.db.E4DBColumnName )

getDistinctData

public java.lang.String[] getDistinctData(E4DBColumnName column)
                                   throws E4DBException
Based on the opened database query object ("this"), a SELECT DICTINCT column will be performed. You can also use filter conditions.

Parameters:
column - the column for the distinct query
Returns:
null, if no data is present or an array of sorted data as String except null values
Throws:
E4DBException
See Also:
executeDistinctQuery(e4s.db.E4DBColumnName)

executeDistinctQuery

public void executeDistinctQuery(E4DBColumnName column)
                          throws E4DBException
Throws:
E4DBException

executeDistinctQuery

public void executeDistinctQuery(E4DBColumnName[] columns)
                          throws E4DBException
Throws:
E4DBException

next

public boolean next()
             throws E4DBException
Fetch next record.

Returns:
true, if a record is available
Throws:
E4DBException

getE4String

public E4String getE4String(E4DBColumnName fieldName)
                     throws E4DBException
Throws:
E4DBException

getString

public java.lang.String getString(E4DBColumnName fieldName)
                           throws E4DBException
Throws:
E4DBException

getE4Long

public E4Long getE4Long(E4DBColumnName fieldName)
                 throws E4DBException
Throws:
E4DBException

getLong

public long getLong(E4DBColumnName fieldName)
             throws E4DBException
Throws:
E4DBException

getInt

public int getInt(E4DBColumnName fieldName)
           throws E4DBException
Throws:
E4DBException

getDate

public java.util.Date getDate(E4DBColumnName fieldName)
                       throws E4DBException
Throws:
E4DBException

toString

public static final java.lang.String toString(java.util.Date dat)
Convert a date to a string, using the date-picture format.

Parameters:
dat - a date value
Returns:
null if dat is null or the formatted string according the datepicture
See Also:
DB_DATEFORMAT, toDate(String)

toDate

public static final java.util.Date toDate(java.lang.String dStr)
                                   throws E4DBException
Convert a string to a date, using the date-picture format.

Parameters:
dStr - a string in the date format
Returns:
null if dStr is empty or the date representation
Throws:
E4DBException
See Also:
DB_DATEFORMAT, toString(java.util.Date)

getBoolean

public boolean getBoolean(E4DBColumnName fieldName)
                   throws E4DBException
Throws:
E4DBException

getFloat

public float getFloat(E4DBColumnName fieldName)
               throws E4DBException
Throws:
E4DBException

getDouble

public double getDouble(E4DBColumnName fieldName)
                 throws E4DBException
Throws:
E4DBException

close

public void close()
           throws E4DBException
Close the database connection (if pooling is enabled #e4s.db.E4DBConnection_Intf#connectionIsPooled).

Throws:
E4DBException

finalize

public void finalize()
Overrides:
finalize in class E4DBFilter

reset

public void reset()
           throws E4DBException
Throws:
E4DBException

getMetaData

public E4DBResultSetMetaData getMetaData()
                                  throws E4DBException
Throws:
E4DBException

setOrderBy

public void setOrderBy(E4DBColumnName column,
                       boolean descending)

setOrderExtended

public void setOrderExtended(java.lang.String orderstring,
                             boolean descending)
Set an individual expression for the sortorder. It will be either appended using ORDER BY when it was the first sort-item or just seperated by a comma to any previous items. Take careful use of this function.

See Also:
setOrderBy(e4s.db.E4DBColumnName)

setOrderBy

public void setOrderBy(E4DBColumnName column)

resetOrderBy

public void resetOrderBy()

isUnicodeEnabled

public static boolean isUnicodeEnabled()
Determine, if UNICODE is enabled. Uses the static return value from E4DBSelect.

Returns:
true, if Unicode is enabled
See Also:
isUnicodeEnabled(), enableUnicode(boolean), HTML.isUTF8enabled(), HTML.enableUTF8(boolean), enableUnicode(boolean)

enableUnicode

public static void enableUnicode(boolean unicode)

toString

public java.lang.String toString()
Last SQL statement executed.

Overrides:
toString in class E4DBFilterAnd
Returns:
the last executed SQL String

supportsSorting

public boolean supportsSorting()

getTableName

public E4DBTableName getTableName()
Get the table name.

Returns:
the name of the associated database table.

getConnection

public E4DBConnection_Intf getConnection()
Get the database connection.


setConnection

public void setConnection(E4DBConnection_Intf con)
Sets the database connection.

See Also:
getConnection()

removeOwnTableColumn

protected static E4DBTypeUsage[] removeOwnTableColumn(E4DBTypeUsage[] defs,
                                                      E4DBTableName table,
                                                      E4DBColumnName column)

getReferenceDelete

public E4DBReference[] getReferenceDelete(E4DBColumnName dummy)
                                   throws E4DBException
Return null.

Throws:
E4DBException

getReferenceLookup

public E4DBReference[] getReferenceLookup(E4DBColumnName dummy)
                                   throws E4DBException
Return null.

Throws:
E4DBException

executeSQL

public static java.sql.ResultSet executeSQL(E4ApplObj_Intf appobj,
                                            java.lang.String sql)
                                     throws E4DBException
Throws:
E4DBException

executeSQL

public static java.sql.ResultSet executeSQL(E4DBConnection_Intf con,
                                            E4ApplObj_Intf appobj,
                                            java.lang.String sql)
                                     throws E4DBException
Throws:
E4DBException

executeSQL

public static java.sql.ResultSet executeSQL(E4DBConnection_Intf con,
                                            java.lang.String sql)
                                     throws E4DBException
Throws:
E4DBException

setFilterQuery

public void setFilterQuery(E4DBColumnInfo col,
                           E4String values)
                    throws E4DBException
Depending on the type of field (String, long, ..) this function will analyze the specified values String, which can contain more than one value. Each value must be seperated by ',' or \t. If a value contains '*' then a SQL-LIKE is built, instead a SQL-IN query list will be passed.

Parameters:
col - the column name
values - the values, null or empty String will be ignored here
Throws:
E4DBException

setFilterQuery

public void setFilterQuery(E4DBColumnInfo col,
                           java.lang.String values)
                    throws E4DBException
Depending on the type of field (String, long, ..) this function will analyze the specified values String, which can contain more than one value. Each value must be seperated by ',' or \t. If a value contains '*' then a SQL-LIKE is built, instead a SQL-IN query list will be passed.

Parameters:
col - the column name
values - the values, null or empty String will be ignored here
Throws:
E4DBException

isTable

public boolean isTable()
Is this data access object a table?

Returns:
true
See Also:
isView()

isView

public boolean isView()
Is this data access object a view?

Returns:
false
See Also:
isTable()

data2csvHeader

protected void data2csvHeader(E4PrintStream out,
                              E4DBColumnInfo[] cinfo)

data2csvHeader

protected void data2csvHeader(E4PrintStream out,
                              E4DBColumnInfo cinfo)

data2csv

protected void data2csv(E4PrintStream out,
                        E4String data)

data2csv

protected void data2csv(E4PrintStream out,
                        java.lang.String data)

data2csv

protected void data2csv(E4PrintStream out,
                        long data)

data2csv

protected void data2csv(E4PrintStream out,
                        float data)

data2csv

protected void data2csv(E4PrintStream out,
                        boolean data)

data2csv

protected void data2csv(E4PrintStream out,
                        java.util.Date data)

data2csv

protected void data2csv(E4PrintStream out,
                        E4Long data)

enableLogging

public void enableLogging()
Enables logging explicit - overrides E4DBLogging default settings based on general .ini settings.

See Also:
disableLogging(), E4DBLogging

disableLogging

public void disableLogging()
Disables logging explicit - overrides E4DBLogging default settings based on general .ini settings.

See Also:
disableLogging(), E4DBLogging

isLogging

public boolean isLogging()
Get the logging state of this E4DBSelect.

Returns:
true if enableLogging() was called or E4DBLogging.isReading() returns true and disableLogging() was not called explicit.
See Also:
e4s.db.E4DBLogging.isReading(), enableLogging(), disableLogging()

getResultSet

public java.sql.ResultSet getResultSet()
Get the underlying JDBC ResultSet.

Returns:
the result set
See Also:
getStatement()

getStatement

public E4DBStatement getStatement()
Get the underlying JDBC Statement.

Returns:
the result set
See Also:
getResultSet()

checkConsistencyTable

public static boolean checkConsistencyTable(E4DBTableName tablename,
                                            boolean is_client_distinctive,
                                            E4DBColumnInfo[] columns)
                                     throws E4DBException
remove this public static boolean checkConsistency( E4DBTableName tablename, boolean dummy, E4DBColumnType columns[] ) { return false; }

Throws:
E4DBException

checkConsistencyTable

public static boolean checkConsistencyTable(E4DBConnection_Intf con,
                                            E4DBTableName tablename,
                                            boolean is_client_distinctive,
                                            E4DBColumnInfo[] columns)
                                     throws E4DBException
Throws:
E4DBException

checkConsistencyTable

public static boolean checkConsistencyTable(E4DBConnection_Intf con,
                                            E4DBTableName tablename,
                                            boolean is_client_distinctive,
                                            E4DBColumnInfo[] columns,
                                            boolean make_correction_table)
                                     throws E4DBException
Throws:
E4DBException

checkConsistencyIndex

public static boolean checkConsistencyIndex(E4DBTableName tablename,
                                            E4DBIndexInfo[] metaschema)
                                     throws E4DBException
Throws:
E4DBException

checkConsistencyIndex

public static boolean checkConsistencyIndex(E4DBConnection_Intf con,
                                            E4DBTableName tablename,
                                            E4DBIndexInfo[] metaschema,
                                            boolean make_correction_indexes)
                                     throws E4DBException
Throws:
E4DBException

getFirstPrimaryIndex

public E4DBIndexInfo getFirstPrimaryIndex()
Get the fields defined in the first unique index, return null if not available.

Returns:
null.

_getSVNVersionString

public static java.lang.String _getSVNVersionString()
Get version info string from subversion.

Returns:
the version info string.
See Also:
E4Util.getRevisionCodeFromSVN(Class)

www.element4solution.com