net.wgen.op.db
Class SqlStatementBuilder

java.lang.Object
  extended bynet.wgen.op.db.SqlStatementBuilder

public class SqlStatementBuilder
extends java.lang.Object

Builds a Prepared- or CallableStatement from a DatabaseCall object.

Version:
$Id: SqlStatementBuilder.html,v 1.2 2007/01/28 04:09:36 paulfeuer Exp $
Author:
Paul Feuer, Wireless Generation, Inc.

Field Summary
protected  DatabaseCall _call
           
protected  java.sql.Connection _connection
           
protected  LobHandler _lobHandler
           
protected  java.sql.PreparedStatement _statement
           
 
Constructor Summary
SqlStatementBuilder(DatabaseCall call, java.sql.Connection connection)
           
 
Method Summary
 void build()
           
 java.sql.PreparedStatement getStatement()
           
protected  void processConnectionOptions()
          Processes any connections set by the user in their DatabaseCall.
protected  void registerOutput(int idx, Parameter param)
           
protected  void registerParameters()
          Iterates parameters calling setInput and registerOutput.
protected  void setInput(int idx, Parameter param)
          Sets input with special handling for SQLDataParameter, ArrayParameter, Clobs, and Blobs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_call

protected DatabaseCall _call

_connection

protected java.sql.Connection _connection

_statement

protected java.sql.PreparedStatement _statement

_lobHandler

protected LobHandler _lobHandler
Constructor Detail

SqlStatementBuilder

public SqlStatementBuilder(DatabaseCall call,
                           java.sql.Connection connection)
Method Detail

getStatement

public java.sql.PreparedStatement getStatement()

build

public void build()
           throws java.sql.SQLException
Throws:
java.sql.SQLException

registerParameters

protected void registerParameters()
                           throws java.sql.SQLException
Iterates parameters calling setInput and registerOutput.

Throws:
java.sql.SQLException - if a database error occurs

setInput

protected void setInput(int idx,
                        Parameter param)
                 throws java.sql.SQLException
Sets input with special handling for SQLDataParameter, ArrayParameter, Clobs, and Blobs. Parameters defined with jdbcType Types.CLOB and String values, are transformed into Clob objects using DatabaseUtils.CLOB

Parameters:
idx -
param -
Throws:
java.sql.SQLException

registerOutput

protected void registerOutput(int idx,
                              Parameter param)
                       throws java.sql.SQLException
Parameters:
idx -
param -
Throws:
java.sql.SQLException

processConnectionOptions

protected void processConnectionOptions()
                                 throws java.sql.SQLException
Processes any connections set by the user in their DatabaseCall.

Throws:
java.sql.SQLException