Ontimize 5.2072EN

com.ontimize.db.handler
Class MySQLSQLStatementHandler

java.lang.Object
  extended bycom.ontimize.db.handler.DefaultSQLStatementHandler
      extended bycom.ontimize.db.handler.MySQLSQLStatementHandler
All Implemented Interfaces:
SQLStatementHandler

public class MySQLSQLStatementHandler
extends DefaultSQLStatementHandler


Field Summary
static java.lang.String LIMIT
           
static java.lang.String OFFSET
           
 
Fields inherited from class com.ontimize.db.handler.DefaultSQLStatementHandler
CONFLICT_CHARS, queryConditionsProcessor, sqlNameEval, useAsInSubqueries
 
Constructor Summary
MySQLSQLStatementHandler()
           
 
Method Summary
 SQLStatementBuilder.SQLStatement createSelectQuery(java.lang.String table, java.util.Vector requestedColumns, java.util.Hashtable conditions, java.util.Vector wildcards, java.util.Vector columnSorting, int recordCount, boolean descending, boolean forceDistinct)
          Returns a SQLStatement class that stores the information needed to execute a select query.
 SQLStatementBuilder.SQLStatement createSelectQuery(java.lang.String table, java.util.Vector requestedColumns, java.util.Hashtable conditions, java.util.Vector wildcards, java.util.Vector columnSorting, int recordCount, int offset, boolean descending, boolean forceDistinct)
           
protected  java.lang.String[] getColumnNames(java.sql.ResultSetMetaData rsMetaData)
           
 boolean isPageable()
           
 
Methods inherited from class com.ontimize.db.handler.DefaultSQLStatementHandler
addSpecialCharacters, changeColumnNames, checkColumnName, createCountQuery, createCountQuery, createDeleteQuery, createInsertQuery, createJoinSelectQuery, createJoinSelectQuery, createQueryConditions, createQueryConditions, createQueryConditionsWithoutWhere, createSelectQuery, createSelectQuery, createSelectQuery, createSelectQuery, createSelectQuery, createSelectQuery, createSelectQuery, createSelectQuery, createSelectQuery, createSelectQuery, createSortStatement, createSortStatement, createUpdateQuery, getQueryConditionsProcessor, getSQLNameEval, hasIsolationFunction, isDelimited, isUseAsInSubqueries, qualify, readBinaryStream, readCharacterStream, readCharacterStream, resultSetToEntityResult, resultSetToEntityResult, setSQLConditionValuesProcessor, setSQLNameEval, setUseAsInSubqueries
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LIMIT

public static final java.lang.String LIMIT
See Also:
Constant Field Values

OFFSET

public static final java.lang.String OFFSET
See Also:
Constant Field Values
Constructor Detail

MySQLSQLStatementHandler

public MySQLSQLStatementHandler()
Method Detail

createSelectQuery

public SQLStatementBuilder.SQLStatement createSelectQuery(java.lang.String table,
                                                          java.util.Vector requestedColumns,
                                                          java.util.Hashtable conditions,
                                                          java.util.Vector wildcards,
                                                          java.util.Vector columnSorting,
                                                          int recordCount,
                                                          boolean descending,
                                                          boolean forceDistinct)
Description copied from class: DefaultSQLStatementHandler
Returns a SQLStatement class that stores the information needed to execute a select query.

Specified by:
createSelectQuery in interface SQLStatementHandler
Overrides:
createSelectQuery in class DefaultSQLStatementHandler
Parameters:
table - name of the table the query is executed against
requestedColumns - a Vector specifying the requested column name in the query
conditions - condition list used to created the query
wildcards - column list that can use wildcards
columnSorting - column list where query sorting is established
recordCount - number of records requested in the query
forceDistinct - true if query result cannot have duplicated records
descending - true if sorting should be descending
Returns:
a SQLStatement class
See Also:
SQLStatementBuilder.SQLStatement

createSelectQuery

public SQLStatementBuilder.SQLStatement createSelectQuery(java.lang.String table,
                                                          java.util.Vector requestedColumns,
                                                          java.util.Hashtable conditions,
                                                          java.util.Vector wildcards,
                                                          java.util.Vector columnSorting,
                                                          int recordCount,
                                                          int offset,
                                                          boolean descending,
                                                          boolean forceDistinct)
Specified by:
createSelectQuery in interface SQLStatementHandler
Overrides:
createSelectQuery in class DefaultSQLStatementHandler

isPageable

public boolean isPageable()
Specified by:
isPageable in interface SQLStatementHandler
Overrides:
isPageable in class DefaultSQLStatementHandler

getColumnNames

protected java.lang.String[] getColumnNames(java.sql.ResultSetMetaData rsMetaData)
Overrides:
getColumnNames in class DefaultSQLStatementHandler
Parameters:
rsMetaData - Database metadata. See custom implementation at MySQLSQLStatementHandler.
Returns:
Column names.
Since:
5.2071EN-0.1 In mysql 5.x.x rsMetaData.getColumnName(i) is not enough to return column names that have been modified with "as" e.g. select customerid as mycustomer from... In this case, the modifier "mycustomer" is only found by using method rsMetaData.getColumnLabel(i). This patch fixes two possibilities.

Ontimize