info.informatica.data.sql
Class SQLStatement

java.lang.Object
  extended by info.informatica.data.sql.SQLStatement
Direct Known Subclasses:
SQLDataStatement

public class SQLStatement
extends Object

SQL statement.

Author:
amengual at informatica dot info

Constructor Summary
SQLStatement(MetaData metadata, String query)
           
SQLStatement(StatementMetaData metadata)
           
 
Method Summary
 void fillStatement(PreparedStatement stmt, Valueset values)
          Fills the parameters of a given statement with the key fields.
 void fillStatement(PreparedStatement stmt, Valueset values, Iterator<FieldName> params)
          Fills the parameters of a given statement.
 String getStatement()
           
 void onModify()
           
 PreparedStatement prepareStatement(Connection con)
           
 void setStatement(String statement)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SQLStatement

public SQLStatement(MetaData metadata,
                    String query)

SQLStatement

public SQLStatement(StatementMetaData metadata)
Method Detail

setStatement

public void setStatement(String statement)

getStatement

public String getStatement()

toString

public String toString()
Overrides:
toString in class Object

prepareStatement

public PreparedStatement prepareStatement(Connection con)
                                   throws SQLException
Throws:
SQLException

fillStatement

public void fillStatement(PreparedStatement stmt,
                          Valueset values)
                   throws SQLException,
                          DataException
Fills the parameters of a given statement with the key fields.

You do not need to validate the fields first.

Parameters:
stmt - the statement
values - the set of values of the fields
Throws:
DataException - TODO
SQLException

fillStatement

public void fillStatement(PreparedStatement stmt,
                          Valueset values,
                          Iterator<FieldName> params)
                   throws SQLException,
                          DataException
Fills the parameters of a given statement. Parameter i of the Statement is filled with the value of the i-th field name given.

You do not need to validate the fields first.

Parameters:
stmt - the statement
values - the set of values of the fields
params - the dictionary data names (not the UI names) of the fields
Throws:
DataException - TODO
SQLException

onModify

public void onModify()