deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.io.datastore.sql
Class StatementBuffer

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

public class StatementBuffer
extends java.lang.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(java.lang.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(java.lang.String s)
          Appends the given string to the statement.
 void append(java.lang.StringBuffer sb)
          Appends the given StringBuffer to the statement.
 java.util.Iterator<StatementBuffer.StatementArgument> getArgumentsIterator()
          Returns an Iterator over the arguments of the query.
 java.lang.String getQueryString()
          Returns the query string (without the arguments' values).
 java.lang.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(java.lang.String s)
Appends the given string to the statement.

Parameters:
s -

append

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

Parameters:
sb -

addArgument

public void addArgument(java.lang.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 java.lang.String getQueryString()
Returns the query string (without the arguments' values).

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

getArgumentsIterator

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

Returns:
an Iterator over the arguments of the query

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

deegree 2.5 (2011/06/29 09:44 build-8-official)

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