deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.io.datastore.sql
Class StatementBuffer

java.lang.Object
  extended by org.deegree.io.datastore.sql.StatementBuffer

public class StatementBuffer
extends Object

Helper class for the creation and logging of PreparedStatements.

It allows to concatenate the query step by step and holds the arguments of the query as well.

Version:
$Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
Author:
Markus Schneider , last edited by: $Author: mschneider $

Nested Class Summary
 class StatementBuffer.StatementArgument
          Encapsulates an argument value and the SQL type code for the target column.
 
Constructor Summary
StatementBuffer()
           
 
Method Summary
 void addArgument(Object o, int typeCode)
          Appends the given argument (as the replacement value for the '?'
 void append(char c)
          Appends the given character to the statement.
 void append(String s)
          Appends the given string to the statement.
 void append(StringBuffer sb)
          Appends the given StringBuffer to the statement.
 Iterator<StatementBuffer.StatementArgument> getArgumentsIterator()
          Returns an Iterator over the arguments of the query.
 String getQueryString()
          Returns the query string (without the arguments' values).
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StatementBuffer

public StatementBuffer()
Method Detail

append

public void append(char c)
Appends the given character to the statement.

Parameters:
c -

append

public void append(String s)
Appends the given string to the statement.

Parameters:
s -

append

public void append(StringBuffer sb)
Appends the given StringBuffer to the statement.

Parameters:
sb -

addArgument

public void addArgument(Object o,
                        int typeCode)
Appends the given argument (as the replacement value for the '?' character in the query) to the statement.

Parameters:
o -
typeCode -

getQueryString

public String getQueryString()
Returns the query string (without the arguments' values).

Returns:
the query string (without the arguments' values)

getArgumentsIterator

public Iterator<StatementBuffer.StatementArgument> getArgumentsIterator()
Returns an Iterator over the arguments of the query.

Returns:
an Iterator over the arguments of the query

toString

public String toString()
Overrides:
toString in class Object

deegree 2.3 (2010/04/09 10:10 build-4-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org