org.objectweb.jorm.mapper.rdb.adapter
Class BasicRdbAdapter

java.lang.Object
  extended byorg.objectweb.jorm.mapper.rdb.adapter.BasicRdbAdapter
All Implemented Interfaces:
PreparedStatementAdapter, RdbAdapter, ResultsetAdapter, SequenceAdapter, TypeAdapter, ValueAsSQLStringAdapter
Direct Known Subclasses:
CloudscapeAdapter, Db2Adapter, FirebirdAdapter, HsqlAdapter, MckoiAdapter, MysqlAdapter, OracleAdapter, PostgresAdapter, ProgressAdapter, SapdbAdapter, SqlserverAdapter, SybaseAdapter

public class BasicRdbAdapter
extends java.lang.Object
implements RdbAdapter


Field Summary
private static boolean accountForNanos
           
private static java.lang.String CONCAT
           
private static java.lang.String INDEXEDLOCATE
           
protected  Logger logger
           
protected  java.lang.String name
          Is the name of the RdbAdapter.
 
Fields inherited from interface org.objectweb.jorm.mapper.rdb.adapter.api.RdbAdapter
NOSIZE, RANGEATEND, RANGEATSTART, RANGEUNSUPPORTED
 
Fields inherited from interface org.objectweb.jorm.mapper.rdb.adapter.api.TypeAdapter
TYPE_NAMES, TYPECODE_ARRAY, TYPECODE_BIGDECIMAL, TYPECODE_BIGINTEGER, TYPECODE_BOOLEAN, TYPECODE_BYTE, TYPECODE_BYTEARRAY, TYPECODE_CHAR, TYPECODE_CHARARRAY, TYPECODE_DATE, TYPECODE_DOUBLE, TYPECODE_FLOAT, TYPECODE_INT, TYPECODE_LONG, TYPECODE_OBJBOOLEAN, TYPECODE_OBJBYTE, TYPECODE_OBJCHAR, TYPECODE_OBJDOUBLE, TYPECODE_OBJFLOAT, TYPECODE_OBJINT, TYPECODE_OBJLONG, TYPECODE_OBJSHORT, TYPECODE_SERIALIZED, TYPECODE_SHORT, TYPECODE_STRING
 
Constructor Summary
BasicRdbAdapter()
           
BasicRdbAdapter(java.lang.String _name)
           
 
Method Summary
protected  void appendClause(java.lang.StringBuffer sb, java.lang.String clause, java.lang.String value)
           
 void escapeFunctionClose(java.lang.StringBuffer sb)
          Modifies the end of a function expression for the escape syntax.
 void escapeFunctionOpen(java.lang.StringBuffer sb)
          Modifies the start of a function expression for the escape syntax.
protected  boolean existRelation(java.sql.Connection connection, java.lang.String relName, java.lang.String[] relationTypes)
           
 boolean existSequence(java.sql.Connection connection, java.lang.String seqName)
          checks the sequence existence
 boolean existTable(java.sql.Connection connection, java.lang.String tableName)
          checks the table existence
 boolean existView(java.sql.Connection connection, java.lang.String viewName)
          checks the view existence
 int fetchResultSetSize(java.sql.ResultSet rs)
          This calculates the size of a result set.
 java.lang.Object getArray(java.sql.ResultSet rs, int idx, java.lang.Object nullValue, int typeCode)
          Get an array value from a ResultSet.
 java.lang.String getArrayElementAsSQLString(java.lang.Object elem, int elemTypeCode)
           
 java.lang.String getArrayToString(java.lang.Object array, int typeCode)
           
 java.lang.String getArrayToStringBegin()
           
 java.lang.String getArrayToStringEnd()
           
 java.lang.String getArrayToStringSeparator()
           
 java.lang.String getArrayValueAsSQLString(java.lang.Object array, int typeCode)
           
 java.lang.String getArrayValueAsSQLString(java.lang.Object array, int typeCode, java.lang.String begin, java.lang.String realsep, java.lang.String end)
           
 java.lang.String getArrayValueAsSQLStringBegin()
           
 java.lang.String getArrayValueAsSQLStringEnd()
           
 java.lang.String getArrayValueAsSQLStringSeparator()
           
 java.math.BigDecimal getBigDecimal(java.sql.ResultSet rs, int idx, java.math.BigDecimal nullValue)
          Get a BigDecimal value from a ResultSet.
 java.math.BigInteger getBigInteger(java.sql.ResultSet rs, int idx, java.math.BigInteger nullValue)
          Get a BigInteger value from a ResultSet.
 boolean getBoolean(java.sql.ResultSet rs, int idx, boolean nullValue)
          Get a boolean value from a ResultSet.
 byte getByte(java.sql.ResultSet rs, int idx, byte nullValue)
          Get a byte value from a ResultSet.
 byte[] getByteArray(java.sql.ResultSet rs, int idx, byte[] nullValue)
          Get a byte[] value from a ResultSet.
protected  java.lang.String getCACHEkeyWord()
           
 char getChar(java.sql.ResultSet rs, int idx, char nullValue)
          Get a char value from a ResultSet.
static char[] getCharArray(java.lang.Object o)
           
private static char[] getCharArray(java.io.Reader reader)
           
 char[] getCharArray(java.sql.ResultSet rs, int idx, char[] nullValue)
          Get a char[] value from a ResultSet.
 java.lang.String getColumnAliasExpr(java.lang.String aliasName)
          Returns a column alias expression.
 java.lang.String getConcatExpression(java.lang.String op1, java.lang.String op2)
           
 java.lang.String getCreateSequence(java.lang.String seqName)
           
 java.lang.String getCreateSequence(java.lang.String seqName, java.lang.Integer startid, java.lang.Integer inc, java.lang.Integer cache)
          CREATE [ TEMPORARY | TEMP ] SEQUENCE name [ INCREMENT [ BY ] increment ] [ MINVALUE minvalue | NO MINVALUE ] [ MAXVALUE maxvalue | NO MAXVALUE ] [ START [ WITH ] start ] [ CACHE cache ] [ [ NO ] CYCLE ]
 java.util.Date getDate(java.sql.ResultSet rs, int idx, java.util.Date nullValue)
          Get a Date value from a ResultSet.
 java.util.Date getDate(java.sql.ResultSet rs, int idx, java.lang.String sqlColumnType, java.util.Date nullValue)
          Get a Date value from a ResultSet.
 double getDouble(java.sql.ResultSet rs, int idx, double nullValue)
          Get a double value from a ResultSet.
 java.lang.String getFirstLocateExpression(java.lang.String substring, java.lang.String instring)
          Returns the expression for searching the position of the first occurrence of a substring in a string.
 float getFloat(java.sql.ResultSet rs, int idx, float nullValue)
          Get a float value from a ResultSet.
protected  void getFromClause(JoinedTable jtMain, JoinedTable jt, JoinedTable.Join join, java.lang.StringBuffer sb)
           
protected  void getFromClause(JoinedTable jt, java.lang.StringBuffer sb)
           
 java.lang.String getFromClause(java.util.List jts)
          Builds a from clause from a list of JoinedTable objects.
protected  java.lang.String getINCREMENTkeyWord()
           
 java.lang.String getIndexedLocateExpression(java.lang.String instring, java.lang.String substring, java.lang.String fromIndex)
          Returns the expression for searching the position of the first occurrence of a substring in a string starting from a given index.
 int getInt(java.sql.ResultSet rs, int idx, int nullValue)
          Get a int value from a ResultSet.
 java.lang.String getLengthOperator()
           
 long getLong(java.sql.ResultSet rs, int idx, long nullValue)
          Get a long value from a ResultSet.
 void getManyNextValInSequence(java.sql.Connection conn, java.lang.String seqName, int numberOfNextVal)
           
 java.lang.String getName()
           
 java.lang.String getNextValInSequence(java.lang.String seqName)
           
 java.lang.Boolean getOboolean(java.sql.ResultSet rs, int idx, java.lang.Boolean nullValue)
          Get a Boolean value from a ResultSet.
 java.lang.Byte getObyte(java.sql.ResultSet rs, int idx, java.lang.Byte nullValue)
          Get a Byte value from a ResultSet.
 java.lang.Character getOchar(java.sql.ResultSet rs, int idx, java.lang.Character nullValue)
          Get a Character value from a ResultSet.
 java.lang.Double getOdouble(java.sql.ResultSet rs, int idx, java.lang.Double nullValue)
          Get a Double value from a ResultSet.
 java.lang.Float getOfloat(java.sql.ResultSet rs, int idx, java.lang.Float nullValue)
          Get a Float value from a ResultSet.
 java.lang.Integer getOint(java.sql.ResultSet rs, int idx, java.lang.Integer nullValue)
          Get a Integer value from a ResultSet.
 java.lang.Long getOlong(java.sql.ResultSet rs, int idx, java.lang.Long nullValue)
          Get a Long value from a ResultSet.
 java.lang.Short getOshort(java.sql.ResultSet rs, int idx, java.lang.Short nullValue)
          Get a Short value from a ResultSet.
 java.lang.String getQuery(java.lang.String selectClause, java.util.List jts, java.lang.String whereClause, boolean rangeStart, boolean rangeSize)
          Builds a query with join and table alias.
 java.lang.String getQuery(java.lang.String selectClause, java.lang.String fromClause, java.lang.String whereClause, java.lang.String orderBy, java.lang.String groupBy, boolean rangeStart, boolean rangeSize)
          Builds a query with join and table alias.
 int getRangeParametersAtStart()
          Indicates whether parameters corresponding to range queries (range start and size) are positioned at the start or at the end of the SQL query.
 java.io.Serializable getSerialized(java.sql.ResultSet rs, int idx, java.io.Serializable nullValue)
          Get a Serializable value from a ResultSet.
 short getShort(java.sql.ResultSet rs, int idx, short nullValue)
          Get a short value from a ResultSet.
 java.lang.String getSqlType(int typeCode, boolean usedInPK, int size, int scale)
          This method returns the SQL type linked to the java type
 int getSqlTypeCode(int typeCode)
          This methods return the SQL type code linked to the java type specified in parameter.
 int getSqlTypeCode(int typeCode, java.lang.String sqlColumnType)
          This methods return the SQL type code linked to the java type specified in parameter.
protected  java.lang.String getSTARTkeyWord()
           
 java.lang.String getString(java.sql.ResultSet rs, int idx, java.lang.String nullValue)
          Get a String value from a ResultSet.
 java.lang.String getSubqueryAlias()
          In the case the subquery needs to be aliased (Postgres), returns a string to be appended to the subquery.
 java.lang.String getValueAsSQLString(boolean value)
          This method returns a String value that represents a boolean value.
 java.lang.String getValueAsSQLString(byte value)
          This method returns a String value that represents a byte value.
 java.lang.String getValueAsSQLString(char value)
          This method returns a String value that represents a char value.
 java.lang.String getValueAsSQLString(double value)
          This method returns a String value that represents a double value.
 java.lang.String getValueAsSQLString(float value)
          This method returns a String value that represents a float value.
 java.lang.String getValueAsSQLString(int value)
          This method returns a String value that represents a int value.
 java.lang.String getValueAsSQLString(long value)
          This method returns a String value that represents a long value.
 java.lang.String getValueAsSQLString(java.lang.Object value, int typeCode)
          This method returns a String value that represents a value.
 java.lang.String getValueAsSQLString(short value)
          This method returns a String value that represents a short value.
 java.lang.String handleOrderBy(java.lang.String query)
           
protected  void modifyQueryWithRange(java.lang.StringBuffer sb, boolean rangeStart, boolean rangeSize)
           
protected  void modifySelectClauseWithRange(java.lang.StringBuffer sb, boolean rangeStart, boolean rangeSize)
           
 void setArray(java.sql.PreparedStatement ps, int idx, java.lang.Object o, int typeCode)
          Assignes an array value into a PreparedStatement
 void setBigDecimal(java.sql.PreparedStatement ps, int idx, java.math.BigDecimal o)
          Assignes a BigDecimal value into a PreparedStatement
 void setBigInteger(java.sql.PreparedStatement ps, int idx, java.math.BigInteger o)
          Assignes a BigInteger value into a PreparedStatement
 void setBoolean(java.sql.PreparedStatement ps, int idx, boolean o)
          Assignes a boolean value into a PreparedStatement
 void setByte(java.sql.PreparedStatement ps, int idx, byte o)
          Assignes a byte value into a PreparedStatement
 void setByteArray(java.sql.PreparedStatement ps, int idx, byte[] o)
          Assignes a byte[] value into a PreparedStatement
 void setChar(java.sql.PreparedStatement ps, int idx, char c)
          Assignes a char value into a PreparedStatement
 void setCharArray(java.sql.PreparedStatement ps, int idx, char[] o)
          Assignes a char[] value into a PreparedStatement
 void setDate(java.sql.PreparedStatement ps, int idx, java.util.Date o, java.lang.String columnType)
          Assignes a String value into a PreparedStatement
 void setDouble(java.sql.PreparedStatement ps, int idx, double o)
          Assignes a double value into a PreparedStatement
 void setFloat(java.sql.PreparedStatement ps, int idx, float o)
          Assignes a float value into a PreparedStatement
 void setInt(java.sql.PreparedStatement ps, int idx, int o)
          Assignes an int value into a PreparedStatement
 void setLogger(Logger _logger)
          Sets the corresponding Monolog logger.
 void setLong(java.sql.PreparedStatement ps, int idx, long o)
          Assignes a long value into a PreparedStatement
 void setNull(java.sql.PreparedStatement ps, int idx, int sqlType)
          Assignes a null value into a PreparedStatement
 void setOboolean(java.sql.PreparedStatement ps, int idx, java.lang.Boolean o)
          Assignes a Boolean value into a PreparedStatement
 void setObyte(java.sql.PreparedStatement ps, int idx, java.lang.Byte o)
          Assignes a Byte value into a PreparedStatement
 void setOchar(java.sql.PreparedStatement ps, int idx, java.lang.Character o)
          Assignes a Character value into a PreparedStatement
 void setOdouble(java.sql.PreparedStatement ps, int idx, java.lang.Double o)
          Assignes a Double value into a PreparedStatement
 void setOfloat(java.sql.PreparedStatement ps, int idx, java.lang.Float o)
          Assignes a Float value into a PreparedStatement
 void setOint(java.sql.PreparedStatement ps, int idx, java.lang.Integer o)
          Assignes an Integer value into a PreparedStatement
 void setOlong(java.sql.PreparedStatement ps, int idx, java.lang.Long o)
          Assignes a Long value into a PreparedStatement
 void setOshort(java.sql.PreparedStatement ps, int idx, java.lang.Short o)
          Assignes a Short value into a PreparedStatement
 void setSerialized(java.sql.PreparedStatement ps, int idx, java.io.Serializable o)
          Assignes a serializable value into a PreparedStatement
 void setShort(java.sql.PreparedStatement ps, int idx, short o)
          Assignes a short value into a PreparedStatement
 void setString(java.sql.PreparedStatement ps, int idx, java.lang.String o)
          Assignes a value into a PreparedStatement
private static java.util.Date sqldate2date(java.sql.Date d)
           
 boolean supportArray(int elemTypeCode)
           
 boolean supportBatchPreparedStatement()
          Indicates if the driver supports the batch of PreparedStatement
private static java.util.Date time2date(java.sql.Time t)
           
private static java.util.Date timestamp2date(java.sql.Timestamp tstamp)
           
 void writeColumnAlias(java.lang.String alias, java.lang.StringBuffer sb)
          Append a column alias to an SQL expression.
 void writeTableAlias(java.lang.String alias, java.lang.StringBuffer sb)
          Append a table alias to an SQL expression.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONCAT

private static final java.lang.String CONCAT
See Also:
Constant Field Values

INDEXEDLOCATE

private static final java.lang.String INDEXEDLOCATE
See Also:
Constant Field Values

logger

protected Logger logger

name

protected java.lang.String name
Is the name of the RdbAdapter. The name is used, in particular, in the RdbAdapter factory for choosing an adapter.


accountForNanos

private static final boolean accountForNanos
Constructor Detail

BasicRdbAdapter

public BasicRdbAdapter()

BasicRdbAdapter

public BasicRdbAdapter(java.lang.String _name)
Method Detail

supportBatchPreparedStatement

public boolean supportBatchPreparedStatement()
Description copied from interface: RdbAdapter
Indicates if the driver supports the batch of PreparedStatement

Specified by:
supportBatchPreparedStatement in interface RdbAdapter

getName

public java.lang.String getName()
Specified by:
getName in interface RdbAdapter
Returns:
The name of the RdbAdapter. This name is used in the factory to register the RdbAdapter instance. In addition it is supposes that the adapter is a part of the class name of the rdb adapter in respect to the following pattern: org.objectweb.jorm.mapper.rdb.XxxxAdapter where Xxxx is the adapter name with the upper first letter.

getSqlTypeCode

public int getSqlTypeCode(int typeCode)
                   throws RdbAdapterException
This methods return the SQL type code linked to the java type specified in parameter.

Specified by:
getSqlTypeCode in interface TypeAdapter
Returns:
An int constant defined in the java.sql.Types class
Throws:
RdbAdapterException

getSqlTypeCode

public int getSqlTypeCode(int typeCode,
                          java.lang.String sqlColumnType)
                   throws RdbAdapterException
This methods return the SQL type code linked to the java type specified in parameter.

Specified by:
getSqlTypeCode in interface TypeAdapter
Returns:
An int constant defined in the java.sql.Types class
Throws:
RdbAdapterException

getSqlType

public java.lang.String getSqlType(int typeCode,
                                   boolean usedInPK,
                                   int size,
                                   int scale)
                            throws RdbAdapterException
Description copied from interface: TypeAdapter
This method returns the SQL type linked to the java type

Specified by:
getSqlType in interface TypeAdapter
Parameters:
typeCode - is the type code of the java type
usedInPK - indicates if the type has to be used into a Primary key
size - can indicates the expected size of the type. If it equals to NO_SIZE that means no size is expected. This parameter can be used for float, BigXXX numbers, String,...
scale - can indicates the expected scale of the type. If it equals to NO_SIZE that means no scale is expected.
Throws:
RdbAdapterException

setNull

public void setNull(java.sql.PreparedStatement ps,
                    int idx,
                    int sqlType)
             throws java.sql.SQLException
Description copied from interface: PreparedStatementAdapter
Assignes a null value into a PreparedStatement

Specified by:
setNull in interface PreparedStatementAdapter
Parameters:
ps - is the PreparedStatement
idx - is the index of the the value in the PreparedStatement
sqlType - is the type of the column
Throws:
java.sql.SQLException

fetchResultSetSize

public int fetchResultSetSize(java.sql.ResultSet rs)
                       throws java.sql.SQLException
This calculates the size of a result set. If this feature is not supported by a database or its jdbc driver, this method returns -1.

Specified by:
fetchResultSetSize in interface RdbAdapter
Parameters:
rs - the result set which the size must be returned
Throws:
java.sql.SQLException

getValueAsSQLString

public java.lang.String getValueAsSQLString(java.lang.Object value,
                                            int typeCode)
Description copied from interface: ValueAsSQLStringAdapter
This method returns a String value that represents a value. This method can be used for the constant parameters of SQL queries.

Specified by:
getValueAsSQLString in interface ValueAsSQLStringAdapter
Parameters:
value -
typeCode - is the java type of the value

getArrayToStringBegin

public java.lang.String getArrayToStringBegin()

getArrayToStringEnd

public java.lang.String getArrayToStringEnd()

getArrayToStringSeparator

public java.lang.String getArrayToStringSeparator()

getArrayToString

public java.lang.String getArrayToString(java.lang.Object array,
                                         int typeCode)
Specified by:
getArrayToString in interface PreparedStatementAdapter

getArrayValueAsSQLStringBegin

public java.lang.String getArrayValueAsSQLStringBegin()

getArrayValueAsSQLStringEnd

public java.lang.String getArrayValueAsSQLStringEnd()

getArrayValueAsSQLStringSeparator

public java.lang.String getArrayValueAsSQLStringSeparator()

getArrayElementAsSQLString

public java.lang.String getArrayElementAsSQLString(java.lang.Object elem,
                                                   int elemTypeCode)

getArrayValueAsSQLString

public java.lang.String getArrayValueAsSQLString(java.lang.Object array,
                                                 int typeCode)

getArrayValueAsSQLString

public java.lang.String getArrayValueAsSQLString(java.lang.Object array,
                                                 int typeCode,
                                                 java.lang.String begin,
                                                 java.lang.String realsep,
                                                 java.lang.String end)

getValueAsSQLString

public java.lang.String getValueAsSQLString(boolean value)
Description copied from interface: ValueAsSQLStringAdapter
This method returns a String value that represents a boolean value. This method can be used for the constant parameters of SQL queries.

Specified by:
getValueAsSQLString in interface ValueAsSQLStringAdapter

getValueAsSQLString

public java.lang.String getValueAsSQLString(byte value)
Description copied from interface: ValueAsSQLStringAdapter
This method returns a String value that represents a byte value. This method can be used for the constant parameters of SQL queries.

Specified by:
getValueAsSQLString in interface ValueAsSQLStringAdapter

getValueAsSQLString

public java.lang.String getValueAsSQLString(char value)
Description copied from interface: ValueAsSQLStringAdapter
This method returns a String value that represents a char value. This method can be used for the constant parameters of SQL queries.

Specified by:
getValueAsSQLString in interface ValueAsSQLStringAdapter

getValueAsSQLString

public java.lang.String getValueAsSQLString(short value)
Description copied from interface: ValueAsSQLStringAdapter
This method returns a String value that represents a short value. This method can be used for the constant parameters of SQL queries.

Specified by:
getValueAsSQLString in interface ValueAsSQLStringAdapter

getValueAsSQLString

public java.lang.String getValueAsSQLString(int value)
Description copied from interface: ValueAsSQLStringAdapter
This method returns a String value that represents a int value. This method can be used for the constant parameters of SQL queries.

Specified by:
getValueAsSQLString in interface ValueAsSQLStringAdapter

getValueAsSQLString

public java.lang.String getValueAsSQLString(long value)
Description copied from interface: ValueAsSQLStringAdapter
This method returns a String value that represents a long value. This method can be used for the constant parameters of SQL queries.

Specified by:
getValueAsSQLString in interface ValueAsSQLStringAdapter

getValueAsSQLString

public java.lang.String getValueAsSQLString(float value)
Description copied from interface: ValueAsSQLStringAdapter
This method returns a String value that represents a float value. This method can be used for the constant parameters of SQL queries.

Specified by:
getValueAsSQLString in interface ValueAsSQLStringAdapter

getValueAsSQLString

public java.lang.String getValueAsSQLString(double value)
Description copied from interface: ValueAsSQLStringAdapter
This method returns a String value that represents a double value. This method can be used for the constant parameters of SQL queries.

Specified by:
getValueAsSQLString in interface ValueAsSQLStringAdapter

getBoolean

public boolean getBoolean(java.sql.ResultSet rs,
                          int idx,
                          boolean nullValue)
                   throws java.sql.SQLException
Description copied from interface: ResultsetAdapter
Get a boolean value from a ResultSet.

Specified by:
getBoolean in interface ResultsetAdapter
Parameters:
rs - is the result where to get the value
idx - is the index of the value in the resultset
nullValue - represents the nullvalue to return if the column is null in the resultset
Throws:
java.sql.SQLException

getOboolean

public java.lang.Boolean getOboolean(java.sql.ResultSet rs,
                                     int idx,
                                     java.lang.Boolean nullValue)
                              throws java.sql.SQLException
Description copied from interface: ResultsetAdapter
Get a Boolean value from a ResultSet.

Specified by:
getOboolean in interface ResultsetAdapter
Parameters:
rs - is the result where to get the value
idx - is the index of the value in the resultset
nullValue - represents the nullvalue to return if the column is null in the resultset
Throws:
java.sql.SQLException

getChar

public char getChar(java.sql.ResultSet rs,
                    int idx,
                    char nullValue)
             throws java.sql.SQLException
Description copied from interface: ResultsetAdapter
Get a char value from a ResultSet.

Specified by:
getChar in interface ResultsetAdapter
Parameters:
rs - is the result where to get the value
idx - is the index of the value in the resultset
nullValue - represents the nullvalue to return if the column is null in the resultset
Throws:
java.sql.SQLException

getOchar

public java.lang.Character getOchar(java.sql.ResultSet rs,
                                    int idx,
                                    java.lang.Character nullValue)
                             throws java.sql.SQLException
Description copied from interface: ResultsetAdapter
Get a Character value from a ResultSet.

Specified by:
getOchar in interface ResultsetAdapter
Parameters:
rs - is the result where to get the value
idx - is the index of the value in the resultset
nullValue - represents the nullvalue to return if the column is null in the resultset
Throws:
java.sql.SQLException

getByte

public byte getByte(java.sql.ResultSet rs,
                    int idx,
                    byte nullValue)
             throws java.sql.SQLException
Description copied from interface: ResultsetAdapter
Get a byte value from a ResultSet.

Specified by:
getByte in interface ResultsetAdapter
Parameters:
rs - is the result where to get the value
idx - is the index of the value in the resultset
nullValue - represents the nullvalue to return if the column is null in the resultset
Throws:
java.sql.SQLException

getObyte

public java.lang.Byte getObyte(java.sql.ResultSet rs,
                               int idx,
                               java.lang.Byte nullValue)
                        throws java.sql.SQLException
Description copied from interface: ResultsetAdapter
Get a Byte value from a ResultSet.

Specified by:
getObyte in interface ResultsetAdapter
Parameters:
rs - is the result where to get the value
idx - is the index of the value in the resultset
nullValue - represents the nullvalue to return if the column is null in the resultset
Throws:
java.sql.SQLException

getShort

public short getShort(java.sql.ResultSet rs,
                      int idx,
                      short nullValue)
               throws java.sql.SQLException
Description copied from interface: ResultsetAdapter
Get a short value from a ResultSet.

Specified by:
getShort in interface ResultsetAdapter
Parameters:
rs - is the result where to get the value
idx - is the index of the value in the resultset
nullValue - represents the nullvalue to return if the column is null in the resultset
Throws:
java.sql.SQLException

getOshort

public java.lang.Short getOshort(java.sql.ResultSet rs,
                                 int idx,
                                 java.lang.Short nullValue)
                          throws java.sql.SQLException
Description copied from interface: ResultsetAdapter
Get a Short value from a ResultSet.

Specified by:
getOshort in interface ResultsetAdapter
Parameters:
rs - is the result where to get the value
idx - is the index of the value in the resultset
nullValue - represents the nullvalue to return if the column is null in the resultset
Throws:
java.sql.SQLException

getInt

public int getInt(java.sql.ResultSet rs,
                  int idx,
                  int nullValue)
           throws java.sql.SQLException
Description copied from interface: ResultsetAdapter
Get a int value from a ResultSet.

Specified by:
getInt in interface ResultsetAdapter
Parameters:
rs - is the result where to get the value
idx - is the index of the value in the resultset
nullValue - represents the nullvalue to return if the column is null in the resultset
Throws:
java.sql.SQLException

getOint

public java.lang.Integer getOint(java.sql.ResultSet rs,
                                 int idx,
                                 java.lang.Integer nullValue)
                          throws java.sql.SQLException
Description copied from interface: ResultsetAdapter
Get a Integer value from a ResultSet.

Specified by:
getOint in interface ResultsetAdapter
Parameters:
rs - is the result where to get the value
idx - is the index of the value in the resultset
nullValue - represents the nullvalue to return if the column is null in the resultset
Throws:
java.sql.SQLException

getLong

public long getLong(java.sql.ResultSet rs,
                    int idx,
                    long nullValue)
             throws java.sql.SQLException
Description copied from interface: ResultsetAdapter
Get a long value from a ResultSet.

Specified by:
getLong in interface ResultsetAdapter
Parameters:
rs - is the result where to get the value
idx - is the index of the value in the resultset
nullValue - represents the nullvalue to return if the column is null in the resultset
Throws:
java.sql.SQLException

getOlong

public java.lang.Long getOlong(java.sql.ResultSet rs,
                               int idx,
                               java.lang.Long nullValue)
                        throws java.sql.SQLException
Description copied from interface: ResultsetAdapter
Get a Long value from a ResultSet.

Specified by:
getOlong in interface ResultsetAdapter
Parameters:
rs - is the result where to get the value
idx - is the index of the value in the resultset
nullValue - represents the nullvalue to return if the column is null in the resultset
Throws:
java.sql.SQLException

getFloat

public float getFloat(java.sql.ResultSet rs,
                      int idx,
                      float nullValue)
               throws java.sql.SQLException
Description copied from interface: ResultsetAdapter
Get a float value from a ResultSet.

Specified by:
getFloat in interface ResultsetAdapter
Parameters:
rs - is the result where to get the value
idx - is the index of the value in the resultset
nullValue - represents the nullvalue to return if the column is null in the resultset
Throws:
java.sql.SQLException

getOfloat

public java.lang.Float getOfloat(java.sql.ResultSet rs,
                                 int idx,
                                 java.lang.Float nullValue)
                          throws java.sql.SQLException
Description copied from interface: ResultsetAdapter
Get a Float value from a ResultSet.

Specified by:
getOfloat in interface ResultsetAdapter
Parameters:
rs - is the result where to get the value
idx - is the index of the value in the resultset
nullValue - represents the nullvalue to return if the column is null in the resultset
Throws:
java.sql.SQLException

getDouble

public double getDouble(java.sql.ResultSet rs,
                        int idx,
                        double nullValue)
                 throws java.sql.SQLException
Description copied from interface: ResultsetAdapter
Get a double value from a ResultSet.

Specified by:
getDouble in interface ResultsetAdapter
Parameters:
rs - is the result where to get the value
idx - is the index of the value in the resultset
nullValue - represents the nullvalue to return if the column is null in the resultset
Throws:
java.sql.SQLException

getOdouble

public java.lang.Double getOdouble(java.sql.ResultSet rs,
                                   int idx,
                                   java.lang.Double nullValue)
                            throws java.sql.SQLException
Description copied from interface: ResultsetAdapter
Get a Double value from a ResultSet.

Specified by:
getOdouble in interface ResultsetAdapter
Parameters:
rs - is the result where to get the value
idx - is the index of the value in the resultset
nullValue - represents the nullvalue to return if the column is null in the resultset
Throws:
java.sql.SQLException

getString

public java.lang.String getString(java.sql.ResultSet rs,
                                  int idx,
                                  java.lang.String nullValue)
                           throws java.sql.SQLException
Description copied from interface: ResultsetAdapter
Get a String value from a ResultSet.

Specified by:
getString in interface ResultsetAdapter
Parameters:
rs - is the result where to get the value
idx - is the index of the value in the resultset
nullValue - represents the nullvalue to return if the column is null in the resultset
Throws:
java.sql.SQLException

getDate

public java.util.Date getDate(java.sql.ResultSet rs,
                              int idx,
                              java.util.Date nullValue)
                       throws java.sql.SQLException
Description copied from interface: ResultsetAdapter
Get a Date value from a ResultSet.

Specified by:
getDate in interface ResultsetAdapter
Parameters:
rs - is the result where to get the value
idx - is the index of the value in the resultset
nullValue - represents the nullvalue to return if the column is null in the resultset
Throws:
java.sql.SQLException

timestamp2date

private static java.util.Date timestamp2date(java.sql.Timestamp tstamp)

sqldate2date

private static java.util.Date sqldate2date(java.sql.Date d)

time2date

private static java.util.Date time2date(java.sql.Time t)

getDate

public java.util.Date getDate(java.sql.ResultSet rs,
                              int idx,
                              java.lang.String sqlColumnType,
                              java.util.Date nullValue)
                       throws java.sql.SQLException
Description copied from interface: ResultsetAdapter
Get a Date value from a ResultSet.

Specified by:
getDate in interface ResultsetAdapter
Parameters:
rs - is the result where to get the value
idx - is the index of the value in the resultset
nullValue - represents the nullvalue to return if the column is null in the resultset
Throws:
java.sql.SQLException

getCharArray

public char[] getCharArray(java.sql.ResultSet rs,
                           int idx,
                           char[] nullValue)
                    throws java.sql.SQLException
Description copied from interface: ResultsetAdapter
Get a char[] value from a ResultSet.

Specified by:
getCharArray in interface ResultsetAdapter
Parameters:
rs - is the result where to get the value
idx - is the index of the value in the resultset
nullValue - represents the nullvalue to return if the column is null in the resultset
Throws:
java.sql.SQLException

getCharArray

private static char[] getCharArray(java.io.Reader reader)
                            throws java.io.IOException
Throws:
java.io.IOException

getByteArray

public byte[] getByteArray(java.sql.ResultSet rs,
                           int idx,
                           byte[] nullValue)
                    throws java.sql.SQLException
Description copied from interface: ResultsetAdapter
Get a byte[] value from a ResultSet.

Specified by:
getByteArray in interface ResultsetAdapter
Parameters:
rs - is the result where to get the value
idx - is the index of the value in the resultset
nullValue - represents the nullvalue to return if the column is null in the resultset
Throws:
java.sql.SQLException

getSerialized

public java.io.Serializable getSerialized(java.sql.ResultSet rs,
                                          int idx,
                                          java.io.Serializable nullValue)
                                   throws java.sql.SQLException,
                                          java.io.IOException,
                                          java.lang.ClassNotFoundException
Description copied from interface: ResultsetAdapter
Get a Serializable value from a ResultSet.

Specified by:
getSerialized in interface ResultsetAdapter
Parameters:
rs - is the result where to get the value
idx - is the index of the value in the resultset
nullValue - represents the nullvalue to return if the column is null in the resultset
Throws:
java.sql.SQLException
java.io.IOException
java.lang.ClassNotFoundException

getBigDecimal

public java.math.BigDecimal getBigDecimal(java.sql.ResultSet rs,
                                          int idx,
                                          java.math.BigDecimal nullValue)
                                   throws java.sql.SQLException
Description copied from interface: ResultsetAdapter
Get a BigDecimal value from a ResultSet.

Specified by:
getBigDecimal in interface ResultsetAdapter
Parameters:
rs - is the result where to get the value
idx - is the index of the value in the resultset
nullValue - represents the nullvalue to return if the column is null in the resultset
Throws:
java.sql.SQLException

getBigInteger

public java.math.BigInteger getBigInteger(java.sql.ResultSet rs,
                                          int idx,
                                          java.math.BigInteger nullValue)
                                   throws java.sql.SQLException
Description copied from interface: ResultsetAdapter
Get a BigInteger value from a ResultSet.

Specified by:
getBigInteger in interface ResultsetAdapter
Parameters:
rs - is the result where to get the value
idx - is the index of the value in the resultset
nullValue - represents the nullvalue to return if the column is null in the resultset
Throws:
java.sql.SQLException

getArray

public java.lang.Object getArray(java.sql.ResultSet rs,
                                 int idx,
                                 java.lang.Object nullValue,
                                 int typeCode)
                          throws java.sql.SQLException
Description copied from interface: ResultsetAdapter
Get an array value from a ResultSet.

Specified by:
getArray in interface ResultsetAdapter
Parameters:
rs - is the result where to get the value
idx - is the index of the value in the resultset
nullValue - represents the nullvalue to return if the column is null
typeCode - is the type code of the expected array ex: = (TypeAdapter.ARRAY + TypeAdapter.STRING) in the resultset
Throws:
java.sql.SQLException

setBoolean

public void setBoolean(java.sql.PreparedStatement ps,
                       int idx,
                       boolean o)
                throws java.sql.SQLException
Description copied from interface: PreparedStatementAdapter
Assignes a boolean value into a PreparedStatement

Specified by:
setBoolean in interface PreparedStatementAdapter
Parameters:
ps - is the PreparedStatement
idx - is the index of the the value in the PreparedStatement
o - is the value to assign
Throws:
java.sql.SQLException

setOboolean

public void setOboolean(java.sql.PreparedStatement ps,
                        int idx,
                        java.lang.Boolean o)
                 throws java.sql.SQLException
Description copied from interface: PreparedStatementAdapter
Assignes a Boolean value into a PreparedStatement

Specified by:
setOboolean in interface PreparedStatementAdapter
Parameters:
ps - is the PreparedStatement
idx - is the index of the the value in the PreparedStatement
o - is the value to assign
Throws:
java.sql.SQLException

setChar

public void setChar(java.sql.PreparedStatement ps,
                    int idx,
                    char c)
             throws java.sql.SQLException
Description copied from interface: PreparedStatementAdapter
Assignes a char value into a PreparedStatement

Specified by:
setChar in interface PreparedStatementAdapter
Parameters:
ps - is the PreparedStatement
idx - is the index of the the value in the PreparedStatement
c - is the value to assign
Throws:
java.sql.SQLException

setOchar

public void setOchar(java.sql.PreparedStatement ps,
                     int idx,
                     java.lang.Character o)
              throws java.sql.SQLException
Description copied from interface: PreparedStatementAdapter
Assignes a Character value into a PreparedStatement

Specified by:
setOchar in interface PreparedStatementAdapter
Parameters:
ps - is the PreparedStatement
idx - is the index of the the value in the PreparedStatement
o - is the value to assign
Throws:
java.sql.SQLException

setByte

public void setByte(java.sql.PreparedStatement ps,
                    int idx,
                    byte o)
             throws java.sql.SQLException
Description copied from interface: PreparedStatementAdapter
Assignes a byte value into a PreparedStatement

Specified by:
setByte in interface PreparedStatementAdapter
Parameters:
ps - is the PreparedStatement
idx - is the index of the the value in the PreparedStatement
o - is the value to assign
Throws:
java.sql.SQLException

setObyte

public void setObyte(java.sql.PreparedStatement ps,
                     int idx,
                     java.lang.Byte o)
              throws java.sql.SQLException
Description copied from interface: PreparedStatementAdapter
Assignes a Byte value into a PreparedStatement

Specified by:
setObyte in interface PreparedStatementAdapter
Parameters:
ps - is the PreparedStatement
idx - is the index of the the value in the PreparedStatement
o - is the value to assign
Throws:
java.sql.SQLException

setShort

public void setShort(java.sql.PreparedStatement ps,
                     int idx,
                     short o)
              throws java.sql.SQLException
Description copied from interface: PreparedStatementAdapter
Assignes a short value into a PreparedStatement

Specified by:
setShort in interface PreparedStatementAdapter
Parameters:
ps - is the PreparedStatement
idx - is the index of the the value in the PreparedStatement
o - is the value to assign
Throws:
java.sql.SQLException

setOshort

public void setOshort(java.sql.PreparedStatement ps,
                      int idx,
                      java.lang.Short o)
               throws java.sql.SQLException
Description copied from interface: PreparedStatementAdapter
Assignes a Short value into a PreparedStatement

Specified by:
setOshort in interface PreparedStatementAdapter
Parameters:
ps - is the PreparedStatement
idx - is the index of the the value in the PreparedStatement
o - is the value to assign
Throws:
java.sql.SQLException

setInt

public void setInt(java.sql.PreparedStatement ps,
                   int idx,
                   int o)
            throws java.sql.SQLException
Description copied from interface: PreparedStatementAdapter
Assignes an int value into a PreparedStatement

Specified by:
setInt in interface PreparedStatementAdapter
Parameters:
ps - is the PreparedStatement
idx - is the index of the the value in the PreparedStatement
o - is the value to assign
Throws:
java.sql.SQLException

setOint

public void setOint(java.sql.PreparedStatement ps,
                    int idx,
                    java.lang.Integer o)
             throws java.sql.SQLException
Description copied from interface: PreparedStatementAdapter
Assignes an Integer value into a PreparedStatement

Specified by:
setOint in interface PreparedStatementAdapter
Parameters:
ps - is the PreparedStatement
idx - is the index of the the value in the PreparedStatement
o - is the value to assign
Throws:
java.sql.SQLException

setLong

public void setLong(java.sql.PreparedStatement ps,
                    int idx,
                    long o)
             throws java.sql.SQLException
Description copied from interface: PreparedStatementAdapter
Assignes a long value into a PreparedStatement

Specified by:
setLong in interface PreparedStatementAdapter
Parameters:
ps - is the PreparedStatement
idx - is the index of the the value in the PreparedStatement
o - is the value to assign
Throws:
java.sql.SQLException

setOlong

public void setOlong(java.sql.PreparedStatement ps,
                     int idx,
                     java.lang.Long o)
              throws java.sql.SQLException
Description copied from interface: PreparedStatementAdapter
Assignes a Long value into a PreparedStatement

Specified by:
setOlong in interface PreparedStatementAdapter
Parameters:
ps - is the PreparedStatement
idx - is the index of the the value in the PreparedStatement
o - is the value to assign
Throws:
java.sql.SQLException

setFloat

public void setFloat(java.sql.PreparedStatement ps,
                     int idx,
                     float o)
              throws java.sql.SQLException
Description copied from interface: PreparedStatementAdapter
Assignes a float value into a PreparedStatement

Specified by:
setFloat in interface PreparedStatementAdapter
Parameters:
ps - is the PreparedStatement
idx - is the index of the the value in the PreparedStatement
o - is the value to assign
Throws:
java.sql.SQLException

setOfloat

public void setOfloat(java.sql.PreparedStatement ps,
                      int idx,
                      java.lang.Float o)
               throws java.sql.SQLException
Description copied from interface: PreparedStatementAdapter
Assignes a Float value into a PreparedStatement

Specified by:
setOfloat in interface PreparedStatementAdapter
Parameters:
ps - is the PreparedStatement
idx - is the index of the the value in the PreparedStatement
o - is the value to assign
Throws:
java.sql.SQLException

setDouble

public void setDouble(java.sql.PreparedStatement ps,
                      int idx,
                      double o)
               throws java.sql.SQLException
Description copied from interface: PreparedStatementAdapter
Assignes a double value into a PreparedStatement

Specified by:
setDouble in interface PreparedStatementAdapter
Parameters:
ps - is the PreparedStatement
idx - is the index of the the value in the PreparedStatement
o - is the value to assign
Throws:
java.sql.SQLException

setOdouble

public void setOdouble(java.sql.PreparedStatement ps,
                       int idx,
                       java.lang.Double o)
                throws java.sql.SQLException
Description copied from interface: PreparedStatementAdapter
Assignes a Double value into a PreparedStatement

Specified by:
setOdouble in interface PreparedStatementAdapter
Parameters:
ps - is the PreparedStatement
idx - is the index of the the value in the PreparedStatement
o - is the value to assign
Throws:
java.sql.SQLException

setString

public void setString(java.sql.PreparedStatement ps,
                      int idx,
                      java.lang.String o)
               throws java.sql.SQLException
Description copied from interface: PreparedStatementAdapter
Assignes a value into a PreparedStatement

Specified by:
setString in interface PreparedStatementAdapter
Parameters:
ps - is the PreparedStatement
idx - is the index of the the value in the PreparedStatement
o - is the value to assign
Throws:
java.sql.SQLException

setDate

public void setDate(java.sql.PreparedStatement ps,
                    int idx,
                    java.util.Date o,
                    java.lang.String columnType)
             throws java.sql.SQLException
Description copied from interface: PreparedStatementAdapter
Assignes a String value into a PreparedStatement

Specified by:
setDate in interface PreparedStatementAdapter
Parameters:
ps - is the PreparedStatement
idx - is the index of the the value in the PreparedStatement
o - is the value to assign
Throws:
java.sql.SQLException

setCharArray

public void setCharArray(java.sql.PreparedStatement ps,
                         int idx,
                         char[] o)
                  throws java.sql.SQLException
Description copied from interface: PreparedStatementAdapter
Assignes a char[] value into a PreparedStatement

Specified by:
setCharArray in interface PreparedStatementAdapter
Parameters:
ps - is the PreparedStatement
idx - is the index of the the value in the PreparedStatement
o - is the value to assign
Throws:
java.sql.SQLException

setByteArray

public void setByteArray(java.sql.PreparedStatement ps,
                         int idx,
                         byte[] o)
                  throws java.sql.SQLException
Description copied from interface: PreparedStatementAdapter
Assignes a byte[] value into a PreparedStatement

Specified by:
setByteArray in interface PreparedStatementAdapter
Parameters:
ps - is the PreparedStatement
idx - is the index of the the value in the PreparedStatement
o - is the value to assign
Throws:
java.sql.SQLException

setBigInteger

public void setBigInteger(java.sql.PreparedStatement ps,
                          int idx,
                          java.math.BigInteger o)
                   throws java.sql.SQLException
Description copied from interface: PreparedStatementAdapter
Assignes a BigInteger value into a PreparedStatement

Specified by:
setBigInteger in interface PreparedStatementAdapter
Parameters:
ps - is the PreparedStatement
idx - is the index of the the value in the PreparedStatement
o - is the value to assign
Throws:
java.sql.SQLException

setBigDecimal

public void setBigDecimal(java.sql.PreparedStatement ps,
                          int idx,
                          java.math.BigDecimal o)
                   throws java.sql.SQLException
Description copied from interface: PreparedStatementAdapter
Assignes a BigDecimal value into a PreparedStatement

Specified by:
setBigDecimal in interface PreparedStatementAdapter
Parameters:
ps - is the PreparedStatement
idx - is the index of the the value in the PreparedStatement
o - is the value to assign
Throws:
java.sql.SQLException

setSerialized

public void setSerialized(java.sql.PreparedStatement ps,
                          int idx,
                          java.io.Serializable o)
                   throws java.sql.SQLException,
                          java.io.IOException
Description copied from interface: PreparedStatementAdapter
Assignes a serializable value into a PreparedStatement

Specified by:
setSerialized in interface PreparedStatementAdapter
Parameters:
ps - is the PreparedStatement
idx - is the index of the the value in the PreparedStatement
o - is the value to assign
Throws:
java.sql.SQLException
java.io.IOException

setArray

public void setArray(java.sql.PreparedStatement ps,
                     int idx,
                     java.lang.Object o,
                     int typeCode)
              throws java.sql.SQLException
Description copied from interface: PreparedStatementAdapter
Assignes an array value into a PreparedStatement

Specified by:
setArray in interface PreparedStatementAdapter
Parameters:
ps - is the PreparedStatement
idx - is the index of the the value in the PreparedStatement
o - is the value to assign
typeCode - is the type code of the array ex: = (TypeAdapter.ARRAY + TypeAdapter.STRING)
Throws:
java.sql.SQLException

escapeFunctionOpen

public void escapeFunctionOpen(java.lang.StringBuffer sb)
Description copied from interface: RdbAdapter
Modifies the start of a function expression for the escape syntax.

The JDBC standard syntax is "fn{function}".

Specified by:
escapeFunctionOpen in interface RdbAdapter
Parameters:
sb - the function expression to be escaped

escapeFunctionClose

public void escapeFunctionClose(java.lang.StringBuffer sb)
Description copied from interface: RdbAdapter
Modifies the end of a function expression for the escape syntax.

The JDBC standard syntax is "fn{function}".

Specified by:
escapeFunctionClose in interface RdbAdapter
Parameters:
sb - the function expression to be escaped

getConcatExpression

public java.lang.String getConcatExpression(java.lang.String op1,
                                            java.lang.String op2)
Specified by:
getConcatExpression in interface RdbAdapter
Returns:
the use of the concat operator between two strings

getFirstLocateExpression

public java.lang.String getFirstLocateExpression(java.lang.String substring,
                                                 java.lang.String instring)
                                          throws RdbAdapterException
Description copied from interface: RdbAdapter
Returns the expression for searching the position of the first occurrence of a substring in a string.

Three main syntaxes are found: position(substr in str), locate(substr, srt) and instr(str, substr).

Specified by:
getFirstLocateExpression in interface RdbAdapter
Parameters:
substring - The substring searched
instring - The string in which to search the substring
Returns:
The corresponding relational expression.
Throws:
RdbAdapterException

getIndexedLocateExpression

public java.lang.String getIndexedLocateExpression(java.lang.String instring,
                                                   java.lang.String substring,
                                                   java.lang.String fromIndex)
                                            throws RdbAdapterException
Description copied from interface: RdbAdapter
Returns the expression for searching the position of the first occurrence of a substring in a string starting from a given index.

Two main syntaxes are found: instr() and locate()

Specified by:
getIndexedLocateExpression in interface RdbAdapter
Parameters:
instring - The string in which to search the substring
substring - The substring searched
fromIndex - The index from which to start searching
Returns:
The corresponding relational expression.
Throws:
RdbAdapterException

getLengthOperator

public java.lang.String getLengthOperator()
                                   throws RdbAdapterException
Specified by:
getLengthOperator in interface RdbAdapter
Returns:
the name of the length operator
Throws:
RdbAdapterException

getQuery

public java.lang.String getQuery(java.lang.String selectClause,
                                 java.util.List jts,
                                 java.lang.String whereClause,
                                 boolean rangeStart,
                                 boolean rangeSize)
Description copied from interface: RdbAdapter
Builds a query with join and table alias. The implementation must use writeTableAlias(String StringBuffer) method.

Specified by:
getQuery in interface RdbAdapter
Parameters:
selectClause - is a string representation of the select clause
jts - is the tables with their join
whereClause - is a string representation of the where clause
rangeStart - is the rank of the first row to be returned in case of a range limit, starting at 0
rangeSize - is the number of rows to be returned in case of a range limit. The convention is that Integer.MAX_VALUE means no range limit.

getFromClause

public java.lang.String getFromClause(java.util.List jts)
Description copied from interface: RdbAdapter
Builds a from clause from a list of JoinedTable objects.

Specified by:
getFromClause in interface RdbAdapter

appendClause

protected void appendClause(java.lang.StringBuffer sb,
                            java.lang.String clause,
                            java.lang.String value)

getQuery

public java.lang.String getQuery(java.lang.String selectClause,
                                 java.lang.String fromClause,
                                 java.lang.String whereClause,
                                 java.lang.String orderBy,
                                 java.lang.String groupBy,
                                 boolean rangeStart,
                                 boolean rangeSize)
Description copied from interface: RdbAdapter
Builds a query with join and table alias. The implementation must use writeTableAlias(String StringBuffer) method.

Specified by:
getQuery in interface RdbAdapter
Parameters:
selectClause - is a string representation of the select clause
whereClause - is a string representation of the where clause
orderBy - is a string representation of the order by clause
groupBy - is a string representation of the group by clause
rangeStart - is the rank of the first row to be returned in case of a range limit, starting at 0
rangeSize - is the number of rows to be returned in case of a range limit. The convention is that Integer.MAX_VALUE means no range limit.

getFromClause

protected void getFromClause(JoinedTable jt,
                             java.lang.StringBuffer sb)

writeTableAlias

public void writeTableAlias(java.lang.String alias,
                            java.lang.StringBuffer sb)
Description copied from interface: RdbAdapter
Append a table alias to an SQL expression. To be used when constructing the string expression of a from clause. For example, most database recognize the syntax 'select ... from R as ALIAS_FOR_R, S as ALIAS_FOR_S ... ' whereas Orabcle accepts the following syntax : 'select ... from R ALIAS_FOR_R, S ALIAS_FOR_S ... '

Specified by:
writeTableAlias in interface RdbAdapter
Parameters:
alias - The table alias
sb - The StringBuffer into which to write the alias.

writeColumnAlias

public void writeColumnAlias(java.lang.String alias,
                             java.lang.StringBuffer sb)
Description copied from interface: RdbAdapter
Append a column alias to an SQL expression. To be used when constructing the string expression of a select clause. For example, most database recognize the syntax 'select A as ALIAS_FOR_A, B as ALIAS_FOR_B ... ' whereas Orabcle accepts the following syntax : 'select A "ALIAS_FOR_A", B "ALIAS_FOR_B" '

Specified by:
writeColumnAlias in interface RdbAdapter
Parameters:
alias - the column alias
sb - The StringBuffer into which to write the alias.

getColumnAliasExpr

public java.lang.String getColumnAliasExpr(java.lang.String aliasName)
Description copied from interface: RdbAdapter
Returns a column alias expression. To be used when constructing the string expression of a select clause. For example, most database recognize the syntax 'select A as ALIAS_FOR_A, B as ALIAS_FOR_B ... ' whereas Orabcle accepts the following syntax : 'select A "ALIAS_FOR_A", B "ALIAS_FOR_B" '

Specified by:
getColumnAliasExpr in interface RdbAdapter
Parameters:
aliasName - the column alias

handleOrderBy

public java.lang.String handleOrderBy(java.lang.String query)
Specified by:
handleOrderBy in interface RdbAdapter

getCreateSequence

public java.lang.String getCreateSequence(java.lang.String seqName)
                                   throws java.lang.UnsupportedOperationException
Specified by:
getCreateSequence in interface SequenceAdapter
Parameters:
seqName - is the sequence name
Returns:
the SQL command to create a sequence
Throws:
java.lang.UnsupportedOperationException

getNextValInSequence

public java.lang.String getNextValInSequence(java.lang.String seqName)
Specified by:
getNextValInSequence in interface SequenceAdapter
Parameters:
seqName - is the sequence name
Returns:
the SQL command to gett a new value in a SQL sequence which the name is given in parameter.

getManyNextValInSequence

public void getManyNextValInSequence(java.sql.Connection conn,
                                     java.lang.String seqName,
                                     int numberOfNextVal)
                              throws RdbAdapterException
Specified by:
getManyNextValInSequence in interface SequenceAdapter
Parameters:
seqName - the sequence name
numberOfNextVal - the number of next val called in the same query
Throws:
RdbAdapterException

existRelation

protected boolean existRelation(java.sql.Connection connection,
                                java.lang.String relName,
                                java.lang.String[] relationTypes)
                         throws java.sql.SQLException
Throws:
java.sql.SQLException

existTable

public boolean existTable(java.sql.Connection connection,
                          java.lang.String tableName)
                   throws java.sql.SQLException
Description copied from interface: RdbAdapter
checks the table existence

Specified by:
existTable in interface RdbAdapter
Parameters:
connection - is the JDBC connection to use
tableName - is the name of the table
Returns:
true if the table exists, otherwise false.
Throws:
java.sql.SQLException

existView

public boolean existView(java.sql.Connection connection,
                         java.lang.String viewName)
                  throws java.sql.SQLException
Description copied from interface: RdbAdapter
checks the view existence

Specified by:
existView in interface RdbAdapter
Parameters:
connection - is the JDBC connection to use
viewName - is the name of the view
Returns:
true if the view exists, otherwise false.
Throws:
java.sql.SQLException

existSequence

public boolean existSequence(java.sql.Connection connection,
                             java.lang.String seqName)
                      throws java.sql.SQLException
Description copied from interface: SequenceAdapter
checks the sequence existence

Specified by:
existSequence in interface SequenceAdapter
Parameters:
connection - is the JDBC connection to use
seqName - is the sequence of the table
Returns:
true if the table exists, otherwise false.
Throws:
java.sql.SQLException

getFromClause

protected void getFromClause(JoinedTable jtMain,
                             JoinedTable jt,
                             JoinedTable.Join join,
                             java.lang.StringBuffer sb)

getCharArray

public static char[] getCharArray(java.lang.Object o)
                           throws java.io.IOException,
                                  RdbAdapterException
Throws:
java.io.IOException
RdbAdapterException

getSubqueryAlias

public java.lang.String getSubqueryAlias()
Description copied from interface: RdbAdapter
In the case the subquery needs to be aliased (Postgres), returns a string to be appended to the subquery.

Specified by:
getSubqueryAlias in interface RdbAdapter
Returns:
the String to be appended to the subquery

getCreateSequence

public java.lang.String getCreateSequence(java.lang.String seqName,
                                          java.lang.Integer startid,
                                          java.lang.Integer inc,
                                          java.lang.Integer cache)
                                   throws java.lang.UnsupportedOperationException
CREATE [ TEMPORARY | TEMP ] SEQUENCE name [ INCREMENT [ BY ] increment ] [ MINVALUE minvalue | NO MINVALUE ] [ MAXVALUE maxvalue | NO MAXVALUE ] [ START [ WITH ] start ] [ CACHE cache ] [ [ NO ] CYCLE ]

Specified by:
getCreateSequence in interface SequenceAdapter
Parameters:
seqName -
startid -
inc -
cache - is the size of the cache
Returns:
the SQL command to create a sequence
Throws:
java.lang.UnsupportedOperationException

setLogger

public void setLogger(Logger _logger)
Description copied from interface: RdbAdapter
Sets the corresponding Monolog logger.

Specified by:
setLogger in interface RdbAdapter
Parameters:
_logger - the Monolog logger attached to the RdbAdapter

getINCREMENTkeyWord

protected java.lang.String getINCREMENTkeyWord()

getSTARTkeyWord

protected java.lang.String getSTARTkeyWord()

getCACHEkeyWord

protected java.lang.String getCACHEkeyWord()

modifySelectClauseWithRange

protected void modifySelectClauseWithRange(java.lang.StringBuffer sb,
                                           boolean rangeStart,
                                           boolean rangeSize)

modifyQueryWithRange

protected void modifyQueryWithRange(java.lang.StringBuffer sb,
                                    boolean rangeStart,
                                    boolean rangeSize)

getRangeParametersAtStart

public int getRangeParametersAtStart()
Description copied from interface: RdbAdapter
Indicates whether parameters corresponding to range queries (range start and size) are positioned at the start or at the end of the SQL query.

Indeed, depending on the database, the SQL syntax may vary, and the parameters can either be put at the front or at the end.

Specified by:
getRangeParametersAtStart in interface RdbAdapter
Returns:
RANGEATSTART if the parameters are at the start, RANGEATEND if they are at the end, RANGEUNSUPPORTED if range queries are not supported by the adapter.

supportArray

public boolean supportArray(int elemTypeCode)
Specified by:
supportArray in interface TypeAdapter