|
Novell exteNd Director 5.2 API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sssw.fw.util.EboSqlHelper
This class contains SQL-related utility methods that are used by objects generating and executing queries. See EbiQuery and its subinterfaces.
Field Summary | |
static int |
JOIN_FULL
SQL JOIN type value for FULL JOIN |
static int |
JOIN_INNER
SQL JOIN type value for INNER JOIN |
static int |
JOIN_LEFT_OUTER
SQL JOIN type value for LEFT OUTER JOIN |
static int |
JOIN_RIGHT_OUTER
SQL JOIN type value for RIGHT OUTER JOIN |
static int |
OP_BETWEEN
This operator corresponds to the SQL 'BETWEEN' operator, e.g., Customer.ID BETWEEN (1, 4) |
static int |
OP_IN
This operator corresponds to the SQL 'IN' operator, e.g., Customer.ID IN (1, 2, 3, 4) |
static int |
OP_IS_NULL
This operator corresponds to the SQL 'IS NULL' condition, e.g., Customer.FIELD1 IS NULL |
static int |
ROP_EQUAL
Relational operator that corresponds to the '=' comparison condition in SQL. |
static int |
ROP_GEQ
Relational operator that corresponds to the '>=' comparison condition in SQL. |
static int |
ROP_GREATER
Relational operator that corresponds to the '>' comparison condition in SQL. |
static int |
ROP_LEQ
Relational operator that corresponds to the '<=' comparison condition in SQL. |
static int |
ROP_LESS
Relational operator that corresponds to the '<' comparison condition in SQL. |
static int |
SOP_ENDS_WITH
String operator that corresponds to the SQL 'LIKE' operator where the pattern specifies items that end with a certain sequence of characters. |
static int |
SOP_EQUALS_IGNORE_CASE
String operator that corresponds to the SQL '=' comparison condition executed on two string operands, where the case of the operands is ignored (e.g. |
static int |
SOP_LIKE
String operator that corresponds to the SQL 'LIKE' operator (e.g. |
static int |
SOP_LIKE_IGNORE_CASE
String operator that corresponds to the SQL 'LIKE' operator executed on two string operands, where the case of the operands is ignored (e.g. |
static int |
SOP_STARTS_WITH
String operator that corresponds to the SQL 'LIKE' operator where the pattern specifies items that start with a certain sequence of characters. |
Constructor Summary | |
EboSqlHelper()
|
Method Summary | |
static String |
genBetween(String tableName,
String colName,
Object first,
Object last,
boolean not)
Generate a SQL query expression using the SQL BETWEEN operator |
static String |
genExpression(String tableName,
String colName,
Object value,
boolean rightAsIs,
int op,
boolean not)
Generate a SQL query expression |
static String |
genIn(String tableName,
String colName,
Object[] ins,
boolean not)
Generate a SQL query expression using the SQL IN operator |
static String |
genOrderBy(String tableName,
String colName,
boolean asc)
Return the ORDER BY entry for a SQL data element |
static String |
getAnsiJoinAsString(int joinType)
Return the string value of an ANSI join type |
static String |
getDbmsName()
Identify the DBMS for the default data source |
static String |
getDbmsName(String dataSource)
Identify the DBMS for a specified data source |
static int |
getDriverMajorVersion()
Return the major version number of the driver for the default data source |
static int |
getDriverMajorVersion(String dataSource)
Return the major version number of the driver for a specified data source |
static int |
getDriverMinorVersion()
Return the minor version number of the driver for the default data source |
static int |
getDriverMinorVersion(String dataSource)
Return the minor version number of the driver for a specified data source |
static String |
getDriverName()
Identify the jdbc driver for the default data source |
static String |
getDriverName(String dataSource)
Identify the JDBC driver for a specified data source |
static String |
getOpAsString(int op,
boolean not)
Return the string value of a SQL query operator |
static String |
getOrderByClause(Collection orderBys)
Return the ORDER BY clause for a SQL query |
static boolean |
isUnaryOp(int op)
Indicate whether the specified operator is unary i.e., operator that works on one operand such as IS NULL |
static boolean |
isValidJoinType(int type)
Indicate whether the specified join type is valid for use in SQL query methods |
static boolean |
isValidOp(int op)
Indicate whether the specified operator is valid for use in SQL query methods |
static boolean |
isValidQueryExprObj(Object o)
Indicate whether the specified object is valid for SQL query expressions |
static String |
parenthesize(String str)
Return a parenthesized string |
static String |
parseDbmsName(String dbmsName)
Parse the JDBC database product name and return a standard name |
static String |
parseDriverName(String driverName)
Parse the JDBC driver name and return a standard name |
static String |
qualifyColName(String tableName,
String colName)
Return the fully qualified name of a SQL data element |
static String |
sqlEscape(String value,
boolean javaEscape)
Escape illegal characters in a literal so that it can be used in SQL statements. |
static String |
wrapString(String wrappee,
String wrapper)
Return a wrapped string |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int ROP_EQUAL
public static final int ROP_LESS
public static final int ROP_LEQ
public static final int ROP_GREATER
public static final int ROP_GEQ
public static final int SOP_LIKE
public static final int SOP_LIKE_IGNORE_CASE
public static final int SOP_STARTS_WITH
public static final int SOP_ENDS_WITH
public static final int SOP_EQUALS_IGNORE_CASE
public static final int OP_IN
public static final int OP_BETWEEN
public static final int OP_IS_NULL
public static final int JOIN_INNER
public static final int JOIN_LEFT_OUTER
public static final int JOIN_RIGHT_OUTER
public static final int JOIN_FULL
Constructor Detail |
public EboSqlHelper()
Method Detail |
public static boolean isValidOp(int op)
op
- the operator identifierpublic static boolean isValidJoinType(int type)
type
- the join type identifierpublic static boolean isValidQueryExprObj(Object o)
obj
- the expression valuepublic static String wrapString(String wrappee, String wrapper)
wrappee
- a string to be wrapped (e.g., "value")wrapper
- the wrapping value (e.g., "'");public static String parenthesize(String str)
str
- a string to be parenthesized (e.g., "col = value")public static String getOpAsString(int op, boolean not)
int
- an operator value (e.g., EboSqlHelper.ROP_EQUAL)not
- specifies whether the value should be negatedpublic static String getAnsiJoinAsString(int joinType)
int
- a join type (e.g., EboSqlHelper.JOIN_INNER)public static String qualifyColName(String tableName, String colName)
tableName
- a table name (e.g., CMDOCUMENTS)colName
- a column name (e.g., DOCNAME)public static String genExpression(String tableName, String colName, Object value, boolean rightAsIs, int op, boolean not)
tableName
- the table namecolName
- the column namevalue
- the value to be incorporated in the expressionop
- the query expression operator (must satisfy isValidOp(op))rightAsIs
- specifies whether the value should be adjusted in any way
(e.g., Strings are wrapped in single quotes). This should normally be set to false.not
- specifies whether the entire expression should be negatedpublic static String genIn(String tableName, String colName, Object[] ins, boolean not)
tableName
- the table namecolName
- the column nameins
- the set of values to be includednot
- specifies whether the entire expression should be negatedpublic static String genBetween(String tableName, String colName, Object first, Object last, boolean not)
tableName
- the table namecolName
- the column namefirst
- the lowest value to be includedlast
- the highest value to be includednot
- specifies whether the entire expression should be negatedpublic static String genOrderBy(String tableName, String colName, boolean asc)
tableName
- a table name (e.g., CMDOCUMENTS)colName
- a column name (e.g., DOCNAME)asc
- specifies whether the sequence is ascendingpublic static String getOrderByClause(Collection orderBys)
orderbys
- a collection of ORDER BY entries (e.g., "CMDOCUMENTS.DOCNAME ASC")public static String sqlEscape(String value, boolean javaEscape)
value
- the literaljavaEscape
- if true, escape by the rules applicable for Java parsers,
otherwise by the rules applicable for SQL parserspublic static boolean isUnaryOp(int op)
op
- the operator identifierpublic static String getDbmsName()
public static String getDbmsName(String dataSource)
dataSource
- the data source namepublic static String parseDbmsName(String dbmsName)
dbmsName
- the database product name reported by JDBC DatabaseMetaDatapublic static String getDriverName()
public static String getDriverName(String dataSource)
dataSource
- the data source namepublic static String parseDriverName(String driverName)
driverName
- the driver name reported by JDBC DatabaseMetaDatapublic static int getDriverMajorVersion()
public static int getDriverMajorVersion(String dataSource)
public static int getDriverMinorVersion()
public static int getDriverMinorVersion(String dataSource)
|
Novell exteNd Director 5.2 API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |