public class PrepareQuery
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
BG
This integer represent of Bigger.
|
static int |
BGE
This integer represent of Bigger or Equal.
|
static int |
DATE
This integer represent of data type.
|
static int |
EQ
This integer represent of Equal.
|
protected java.lang.String[] |
equalityStr |
protected java.lang.String |
errorString |
static int |
INTEGER
This integer represent of data type.
|
protected boolean |
isLocale |
static int |
LK
This integer represent of Like.
|
static int |
NEQ
This integer represent of Not Equal.
|
static int |
NUMBER
This integer represent of data type.
|
protected java.lang.String |
queryStr |
protected java.lang.String[] |
queryString |
static int |
SM
This integer represent of Smaller.
|
static int |
SME
This integer represent of Smaller or Equal.
|
static int |
STRING
This integer represent of data type.
|
Constructor and Description |
---|
PrepareQuery()
PrepareQuery class can use for preparing basic sql sentences.
|
Modifier and Type | Method and Description |
---|---|
void |
convert2EQLs(int[] equalityInt)
This method convert integers to sql comparison operators.
|
java.lang.String[] |
getEqualityStr()
For getting equalityStr
|
java.lang.String |
getErrorString()
For getting errorString
|
java.lang.String |
getQueryStr()
For getting queryStr
|
java.lang.String[] |
setDelete(java.lang.String tableName,
java.lang.String keyField,
java.lang.String keyData)
This method creates and return the delete statement string array.
|
void |
setEqualityStr(java.lang.String[] equalityStr)
For setting equalityStr
|
java.lang.String[] |
setInsert(java.lang.String tableName,
java.lang.String[] fieldNames,
java.lang.String[] formData,
int[] fieldTypes,
DateFormatter dateFormatter)
This method creates the database insert statement and returns as a string array.
|
java.lang.String[] |
setSelect(java.lang.String tableName,
java.lang.String[] fieldNames,
java.lang.String[] formData,
int[] selectFTs,
java.lang.String orderBy,
DateFormatter dateFormatter,
java.lang.String[] selectFields)
Creates and returns the database query statement (select).
|
java.lang.String[] |
setUpdate(java.lang.String tableName,
java.lang.String[] fieldNames,
java.lang.String[] formData,
int[] fieldTypes,
DateFormatter dateFormatter)
Creates and returns a database change statement string array.
|
public static final int STRING
public static final int INTEGER
public static final int DATE
public static final int NUMBER
public static final int EQ
public static final int SM
public static final int BG
public static final int SME
public static final int BGE
public static final int NEQ
public static final int LK
protected java.lang.String[] equalityStr
protected java.lang.String[] queryString
protected java.lang.String errorString
protected java.lang.String queryStr
protected boolean isLocale
public PrepareQuery()
isLocale
- It is for selecting locale or English.public void convert2EQLs(int[] equalityInt)
equalityInt
- Integer representation of comparison operators.public java.lang.String[] setSelect(java.lang.String tableName, java.lang.String[] fieldNames, java.lang.String[] formData, int[] selectFTs, java.lang.String orderBy, DateFormatter dateFormatter, java.lang.String[] selectFields)
tableName
- The table name to be accessed.fieldNames
- Names of fields of the table to access.formData
- An array of data from the HTML form to be used in the SQL statement.selectFTs
- The data types of the fields of the table to access.orderBy
- The field names to sort in the query statement to be generated.dateFormatter
- DateFormatter instance for formatting for dates.selectFields
- List of selected fields from view.public java.lang.String[] setInsert(java.lang.String tableName, java.lang.String[] fieldNames, java.lang.String[] formData, int[] fieldTypes, DateFormatter dateFormatter)
tableName
- The table name to be accessed.fieldNames
- Names of fields of the table to access.formData
- An array of data from the HTML form to be used in the SQL statement.fieldTypes
- The data types of the fields of the table to access.dateFormatter
- The DateFormatter instance to format dates.public java.lang.String[] setUpdate(java.lang.String tableName, java.lang.String[] fieldNames, java.lang.String[] formData, int[] fieldTypes, DateFormatter dateFormatter)
tableName
- The table name to be accessed.fieldNames
- Names of fields of the table to access.formData
- An array of data from the HTML form to be used in the SQL statement.fieldTypes
- The data types of the fields of the table to access.dateFormatter
- The DateFormatter instance to format dates.public java.lang.String[] setDelete(java.lang.String tableName, java.lang.String keyField, java.lang.String keyData)
tableName
- The table name to be accessed.keyField
- The key field name of the table to access.keyData
- Key field data.public java.lang.String[] getEqualityStr()
public void setEqualityStr(java.lang.String[] equalityStr)
equalityStr
- public java.lang.String getErrorString()
public java.lang.String getQueryStr()