com.triactive.jdo.store.sql.expr
Class StatementText

java.lang.Object
  extended bycom.triactive.jdo.store.sql.expr.StatementText

public class StatementText
extends java.lang.Object

The text of an SQL statement, or a fragment thereof.

A StatementText object is basically a StringBuffer that also tracks JDBC statement parameters and their values. The prepareStatement() method can be used to produce a JDBC PreparedStatement object in which any parameters have had their values set into the statement.

Author:
Mike Martin

Constructor Summary
StatementText()
           
StatementText(java.lang.String initialSql)
           
 
Method Summary
 StatementText append(char c)
           
 StatementText append(java.lang.Object o)
           
 StatementText append(StatementText st)
           
 StatementText append(StatementTextGenerator txtGen)
           
 StatementText append(java.lang.String s)
           
 StatementText appendParameter(ColumnMapping mapping, java.lang.Object value)
           
 boolean equals(java.lang.Object obj)
           
 int hashCode()
           
 int length()
           
 java.sql.PreparedStatement prepareStatement(PersistenceManager pm, java.sql.Connection conn)
           
 java.sql.PreparedStatement prepareStatement(PersistenceManager pm, java.sql.Connection conn, int resultSetType, int resultSetConcurrency)
           
 void replaceText(java.lang.String newSql)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StatementText

public StatementText()

StatementText

public StatementText(java.lang.String initialSql)
Method Detail

length

public int length()

append

public StatementText append(char c)

append

public StatementText append(java.lang.String s)

append

public StatementText append(StatementTextGenerator txtGen)

append

public StatementText append(StatementText st)

append

public StatementText append(java.lang.Object o)

appendParameter

public StatementText appendParameter(ColumnMapping mapping,
                                     java.lang.Object value)

replaceText

public void replaceText(java.lang.String newSql)

prepareStatement

public java.sql.PreparedStatement prepareStatement(PersistenceManager pm,
                                                   java.sql.Connection conn)
                                            throws java.sql.SQLException
Throws:
java.sql.SQLException

prepareStatement

public java.sql.PreparedStatement prepareStatement(PersistenceManager pm,
                                                   java.sql.Connection conn,
                                                   int resultSetType,
                                                   int resultSetConcurrency)
                                            throws java.sql.SQLException
Throws:
java.sql.SQLException

hashCode

public int hashCode()

equals

public boolean equals(java.lang.Object obj)

toString

public java.lang.String toString()


Copyright 2001-2007 The TJDO Project All Rights Reserved.