org.objectweb.medor.datasource.rdb.lib
Class JDBCWrapper

java.lang.Object
  extended byorg.objectweb.medor.datasource.rdb.lib.JDBCWrapper
All Implemented Interfaces:
Wrapper

public class JDBCWrapper
extends java.lang.Object
implements Wrapper

This class implements the Wrapper interface for the jdbc resources. This implementation uses Statements to perform the request.

Author:
Mourad Alia

Constructor Summary
JDBCWrapper()
           
 
Method Summary
 long deleteData(QueryLeaf ql, ParameterOperand[] parameters, java.lang.Object connection, EvaluationMetaData evalMD)
          This method links the wrapper to a particular QueryLeaf, and executes the delete on the underlying data store.
 TupleCollection fetchData(QueryLeaf lf, ParameterOperand[] parameters, java.lang.Object connection, EvaluationMetaData evalMD)
          This method links the wrapper to a particular QueryLeaf, and executes the query on the underlying data store for fetching data.
 long updateData(QueryLeaf ql, ParameterOperand[] parameters, java.lang.Object connection, EvaluationMetaData evalMD)
          This method links the wrapper to a particular QueryLeaf, and executes data updating on the underlying data store.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCWrapper

public JDBCWrapper()
Method Detail

fetchData

public TupleCollection fetchData(QueryLeaf lf,
                                 ParameterOperand[] parameters,
                                 java.lang.Object connection,
                                 EvaluationMetaData evalMD)
                          throws EvaluationException
Description copied from interface: Wrapper
This method links the wrapper to a particular QueryLeaf, and executes the query on the underlying data store for fetching data.

Specified by:
fetchData in interface Wrapper
Parameters:
lf - the QueryLeaf
parameters - the parameters necessary for obtaining data from the QueryLeaf (in the case the QueryLeaf contains an expression)
connection - an Object which contains information for connecting to the DataStore behind the QueryLeaf (could be a JDBC connection, ...)s
Returns:
the TupleCollection containing the result of the execution.
Throws:
EvaluationException - in case of problems during the evaluation.

deleteData

public long deleteData(QueryLeaf ql,
                       ParameterOperand[] parameters,
                       java.lang.Object connection,
                       EvaluationMetaData evalMD)
                throws EvaluationException
Description copied from interface: Wrapper
This method links the wrapper to a particular QueryLeaf, and executes the delete on the underlying data store.

Specified by:
deleteData in interface Wrapper
Parameters:
ql - the QueryLeaf
parameters - the parameters necessary for obtaining data from the QueryLeaf (in the case the QueryLeaf contains an expression)
connection - an Object which contains information for connecting to the DataStore behind the QueryLeaf (could be a JDBC connection, ...)s
Returns:
the number of deleted tuples.
Throws:
EvaluationException - in case of problems during the evaluation.

updateData

public long updateData(QueryLeaf ql,
                       ParameterOperand[] parameters,
                       java.lang.Object connection,
                       EvaluationMetaData evalMD)
                throws EvaluationException
Description copied from interface: Wrapper
This method links the wrapper to a particular QueryLeaf, and executes data updating on the underlying data store.

Specified by:
updateData in interface Wrapper
Parameters:
ql - the QueryLeaf
parameters - the parameters necessary for obtaining data from the QueryLeaf (in the case the QueryLeaf contains an expression)
connection - an Object which contains information for connecting to the DataStore behind the QueryLeaf (could be a JDBC connection, ...)s
evalMD - MUST define the update expression with the annotation ANNOTATION_UPDATE_EXPRESSION
Returns:
the number of updated tuples.
Throws:
EvaluationException - in case of problems during the evaluation.
See Also:
EvaluationMetaData.ANNOTATION_UPDATE_EXPRESSION