|
2004.04.29 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--jdc.java.lang.Object
|
+--com.jdc.rdb.sql.SQLClauseHelper
SQLClauseHelper is a utility class that provides Structured Query
Language (SQL) clause helper methods. The
following methods are available:
SQL clause values.Table Column value.formatValue(Object) method supports the following Object
types:
java.lang: Boolean, Byte, Character, Double, Float, Integer, Long, Short, String, and StringBufferjava.math: BigDecimal and BigIntegerjava.sql: Date, Time, and Timestampjava.util: Calendar and DateformatValue(Object) method for additional documentation.
SQLHelper,
Serialized Form| Constructor Summary | |
SQLClauseHelper()
Constructs a new SQLClauseHelper object. |
|
| Method Summary | |
String |
addCommas(ArrayList list)
Returns a comma-delimited String corresponding to the ArrayList. |
String |
addParentheses(String sql)
Adds parentheses to a Structured Query Language ( SQL)
clause value if not already enclosed in parentheses. |
String |
encodeValue(String sql)
Escapes the Structured Query Language ( SQL) clause
value if the SQL clause contains any of the following special
characters: double quotes, single quotes, and/or slashes. |
String |
formatValue(boolean value)
Returns a Structured Query Language ( SQL) formatted
table Column value for the specified boolean
value. |
String |
formatValue(double value)
Returns a Structured Query Language ( SQL) formatted
table Column value for the specified double
value. |
String |
formatValue(long value)
Returns a Structured Query Language ( SQL) formatted
table Column value for the specified long
value. |
String |
formatValue(Object value)
Returns a Structured Query Language ( SQL) formatted
table Column value for the specified Object
type. |
static void |
main(String[] args)
Executes unit tests for the SQLClauseHelper class. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SQLClauseHelper()
SQLClauseHelper object.
| Method Detail |
public String addCommas(ArrayList list)
String corresponding to the ArrayList.
Additionally, the String array values trimmed and a space (blank)
added between the comma-delimited values.
String.public String addParentheses(String sql)
SQL)
clause value if not already enclosed in parentheses.
SQL clause enclosed in parentheses.StringHelper.addParentheses(java.lang.String)public String encodeValue(String sql)
SQL) clause
value if the SQL clause contains any of the following special
characters: double quotes, single quotes, and/or slashes.
SQL clause with special characters encoded.com.jdc.type.StringHelper#escapepublic String formatValue(boolean value)
SQL) formatted
table Column value for the specified boolean
value.
boolean database table Column value.public String formatValue(double value)
SQL) formatted
table Column value for the specified double
value.
double database table Column value.public String formatValue(long value)
SQL) formatted
table Column value for the specified long
value.
long database table Column value.public String formatValue(Object value)
SQL) formatted
table Column value for the specified Object
type. The following standard Object types are directly supported:
java.lang: Boolean, Byte, Character, Double, Float, Integer, Long, Short, String, and StringBufferjava.math: BigDecimal and BigIntegerjava.sql: Date, Time, and Timestampjava.util: Calendar and Datecom.jdc.type: TimestampObject types, the toString method
is invoked. That value is used unless the method returns an Object
address, i.e. the default Object.toString() method.
Column value.public static void main(String[] args)
SQLClauseHelper class.
|
2004.04.29 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||