gov.virginia.dcjs.ws.service
Class AccessSQLFormatter

java.lang.Object
  extended bygov.virginia.dcjs.ws.service.AccessSQLFormatter
All Implemented Interfaces:
SQLFormatter

public class AccessSQLFormatter
extends java.lang.Object
implements SQLFormatter

This class provides MS Access specific functionality for the * SQLFormatter interface.


Constructor Summary
AccessSQLFormatter()
           
 
Method Summary
 java.lang.String getNormalizedType(java.lang.String type)
          Normalize the provided, Access specific, data type name * into one of the types specified in the sql.xsd schema.
 java.lang.String makeBoolean(java.lang.String b)
          Transform the provided keyword string (either * TRUE or FALSE) * into the Access integer values * @param b Boolean keyword to transform.
 java.lang.String makeDate(java.lang.String date)
          Transform the provided date material into a valid Access date literal * or date function, depending upon the content.
 java.lang.String makeOperator(java.lang.String column, java.lang.String operator, java.lang.String value, java.lang.String type)
          Transform the provided content into the Access specific * representation for the specified operator.
 java.lang.String makeText(java.lang.String text)
          Tranform the provided text value into an Access specific * format.
 java.lang.String makeValue(java.lang.String value, java.lang.String type)
          Transform the provided value into the format appropriate * for its type within Access.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccessSQLFormatter

public AccessSQLFormatter()
Method Detail

makeBoolean

public java.lang.String makeBoolean(java.lang.String b)
Transform the provided keyword string (either * TRUE or FALSE) * into the Access integer values * @param b Boolean keyword to transform. * @return 1 for the TRUE * keyword, and 0 otherwise.

Specified by:
makeBoolean in interface SQLFormatter

makeDate

public java.lang.String makeDate(java.lang.String date)
Transform the provided date material into a valid Access date literal * or date function, depending upon the content. If the content * is a keyword (either TODAY or NOW) * then this function returns Date() and * Now() respectively. * Otherwise, the content is turned into a date literal as described * in the return section. This method * also handles the BLANK keyword. * @param date Date material (literal or keyword). Literals must * be in either the yyyy-mm-dd date format or * the yyyy-mm-dd hh:mm:ss datetime format. * @return

Specified by:
makeDate in interface SQLFormatter

makeText

public java.lang.String makeText(java.lang.String text)
Tranform the provided text value into an Access specific * format. This includes enclosing quotes and escaping any * special characters (like an apostrophe). This method * also handles the BLANK keyword. * @param text Content to be transformed into a valid character * content for the Access RDBMS. * @return Character content enclosed in single quotes, with * any internal single quotes escaped with two single quotes. For * example, if the original text is:
* He said, 'Hello.'
* The returned text would become:
* 'He said, ''Hello.'''.

Specified by:
makeText in interface SQLFormatter

makeOperator

public java.lang.String makeOperator(java.lang.String column,
                                     java.lang.String operator,
                                     java.lang.String value,
                                     java.lang.String type)
Transform the provided content into the Access specific * representation for the specified operator. * @param column Name of the column being referenced. * @param operator One of the sql.xsd schema operator values. * @param value Column content to be operated upon. * @param type Value type according to the sql.xsd schema. * @return Each of the sql.xsd operators are translated as follows:

Specified by:
makeOperator in interface SQLFormatter

makeValue

public java.lang.String makeValue(java.lang.String value,
                                  java.lang.String type)
Transform the provided value into the format appropriate * for its type within Access. This method * also handles the BLANK keyword. * @param value Raw value to be transformed. * @param type One of the sql.xsd schema types. * @return Formatted value based upon its type.

Specified by:
makeValue in interface SQLFormatter

getNormalizedType

public java.lang.String getNormalizedType(java.lang.String type)
Normalize the provided, Access specific, data type name * into one of the types specified in the sql.xsd schema. * @param type Access specific type name. * @return Normalized type name according to the sql.xsd schema.

Specified by:
getNormalizedType in interface SQLFormatter