public class SQLDataSource extends BasicDataSource implements RPCManagerCompletionCallback
` SmartClient Server's SQL support is mature, feature-rich and very customizable. See the client reference documentation for details of configuring and using SQL DataSources - search for "sqlDataSource". For a wider general discussion of data integration options with SmartClient Server, search the client documentation for "serverDataIntegration"
inInitState, OP_ADD, OP_CLIENT_EXPORT, OP_CUSTOM, OP_FETCH, OP_REMOVE, OP_UPDATE, OP_VALIDATE
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getSQLClause(SQLClauseType type,
DSRequest dsRequest)
Returns the text of the generated SQL we will use to implement a clause of the supplied
type for the supplied DSRequest.
|
getProperty, shouldAutoJoinTransaction, shouldAutoStartTransaction
add, addDynamicDSGenerator, addDynamicDSGenerator, addDynamicDSGenerator, clearDynamicDSGenerators, execute, executeAdd, executeClientExport, executeCustom, executeFetch, executeRemove, executeUpdate, fetch, fetch, fetchById, fetchSingle, fetchSingle, filter, filter, fromXML, fromXML, fromXML, fromXML, fromXML, fromXML, fromXML, fromXML, getEnumConstantProperty, getEnumOrdinalProperty, getEnumTranslateStrategy, getField, getFieldNames, getListProperties, getListProperties, getPrimaryKey, getProperties, getProperties, getProperties, getPropertyJavaClass, getRecordXPath, getTransactionObject, getTransactionObject, hasRecord, hasRecord, initialized, isModificationOperation, remove, removeDynamicDSGenerator, removeDynamicDSGenerator, removeDynamicDSGenerator, setEnumConstantProperty, setEnumOrdinalProperty, setEnumTranslateStrategy, setProperties, update, validate
onFailure, onSuccess
public static java.lang.String getSQLClause(SQLClauseType type, DSRequest dsRequest) throws java.lang.Exception
$defaultXxxxxClause
Velocity variable that you can use
when developing your own customSQL
queries. Clauses consist of just the
variable part and exclude the SQL keywords. The one exception to this is the special
clause type "All"; if you specify this clause type, we return a full-formed SQL query
suitable for passing straight to the executeQuery() or executeUpdate() method of a JDBC
driver or equivalent.
Note that we ordinarily generate SQL that is self-contained and context-free, so you can store the clauses that this API returns and use them to construct a query for later execution without any dependence on the DSRequest. However, we are not always able to do this; binary columns and CLOBs cannot be assigned inline, so we have to generate SQL containing '?' markers, which can only be executed as parameterized queries. This in turn means that you need to store the values of any such fields in order to provide them as parameters when you come to execute the query.
Also note that the query clauses produced by SQLDataSource are database-specific and will only work if run against the same database product they were generated for.
clauseType
- The type of clause to generate and returndsRequest
- The DSRequest embodying the fetch or update operationclauseType
for the supplied dsRequest
java.lang.Exception