Download Stylus Studio - The World's Best XML Development Environment!


com.ddtek.jxtr
Class JXTRStatement

java.lang.Object
  |
  +--com.ddtek.jxtr.JXTRStatement

public class JXTRStatement
extends java.lang.Object

The JXTRStatement class is used to determine the type of jXTransformer statement (jXTransformer query statement or write statement) and create the corresponding jXTransformer statement object (JXTRQuery or JXTRUpdate).

JXTRStatement only accepts statements using the jXTransformer statement grammar.

Using getStatementType(), you can determine whether the specified statement text corresponds to a jXTransformer query or jXTransformer write statement. Depending on the returned type, use either getQueryStatement(java.sql.Connection), getQueryStatement(java.sql.Connection,int) or getUpdateStatement(java.sql.Connection) to create the correct jXTransformer statement object.


Field Summary
static int TYPE_QUERY
          jXTransformer query statement type.
static int TYPE_UPDATE
          Write statement type (Insert, Update, or Delete).
 
Constructor Summary
JXTRStatement(java.lang.String jxtrStat)
          Creates a new JXTRStatement.
 
Method Summary
 JXTRQuery getQueryStatement(java.sql.Connection con)
          Gets the query statement.
 JXTRQuery getQueryStatement(java.sql.Connection con, int rewriteAlgorithm)
          Creates a JXTRQuery object.
 int getStatementType()
          Gets the statement type.
 JXTRUpdate getUpdateStatement(java.sql.Connection con)
          Creates a JXTRUpdate object.
 boolean getXmlClausesDetected()
          Returns true when the statement contains an XML construct, false when the statement does not contain an XML construct.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_QUERY

public static final int TYPE_QUERY
jXTransformer query statement type.

See Also:
Constant Field Values

TYPE_UPDATE

public static final int TYPE_UPDATE
Write statement type (Insert, Update, or Delete).

See Also:
Constant Field Values
Constructor Detail

JXTRStatement

public JXTRStatement(java.lang.String jxtrStat)
              throws JXTRException
Creates a new JXTRStatement.

Parameters:
jxtrStat - A jXTransformer statement string.
Throws:
java.lang.IllegalArgumentException - if jxtrStat is null.
JXTRException - Refer to the JXTRException class for more information about possible error conditions.
Method Detail

getStatementType

public int getStatementType()
Gets the statement type.

Returns:
TYPE_QUERY or TYPE_UPDATE.

getQueryStatement

public JXTRQuery getQueryStatement(java.sql.Connection con)
                            throws JXTRException
Gets the query statement. Call this method if getStatementType() returns TYPE_QUERY.

Parameters:
con - The JDBC connection.
Returns:
The JXTRQuery object.
Throws:
java.lang.IllegalArgumentException - if con is null.
JXTRException - Refer to the JXTRException class for more information about possible error conditions.

getQueryStatement

public JXTRQuery getQueryStatement(java.sql.Connection con,
                                   int rewriteAlgorithm)
                            throws JXTRException
Creates a JXTRQuery object. Call this method if getStatementType() returns TYPE_QUERY.

Parameters:
con - The JDBC connection.
rewriteAlgorithm - One of the supported jXTransformer query rewrite algorithms.
Returns:
The JXTRQuery object.
Throws:
java.lang.IllegalArgumentException - if con is null.
JXTRException - Refer to the JXTRException class for more information about possible error conditions.

getUpdateStatement

public JXTRUpdate getUpdateStatement(java.sql.Connection con)
                              throws JXTRException
Creates a JXTRUpdate object. Call this method if getStatementType() returns TYPE_UPDATE.

Parameters:
con - The JDBC connection.
Returns:
The JXTRUpdate object.
Throws:
java.lang.IllegalArgumentException - if con is null.
JXTRException - Refer to the JXTRException class for more information about possible error conditions.

getXmlClausesDetected

public boolean getXmlClausesDetected()
Returns true when the statement contains an XML construct, false when the statement does not contain an XML construct.



Stylus Studio features SQL/XML tools for building XML views of relational data.