Package org.voltdb

Class SQLStmt

java.lang.Object
org.voltdb.SQLStmt

public class SQLStmt extends Object

A simple wrapper of a parameterized SQL statement. VoltDB uses this instead of a Java String type for performance reasons and to cache statement meta-data like result schema, compiled plan, etc..

SQLStmts are used exclusively in subclasses of VoltProcedure

See Also:
  • Constructor Details

    • SQLStmt

      public SQLStmt(String sqlText)
      Construct a SQLStmt instance from a SQL statement.
      Parameters:
      sqlText - Valid VoltDB compliant SQL with question marks as parameter place holders.
    • SQLStmt

      public SQLStmt(String sqlText, String joinOrder)
      Construct a SQLStmt instance from a SQL statement.
      Parameters:
      sqlText - Valid VoltDB compliant SQL with question marks as parameter place holders.
      joinOrder - separated list of tables used by the query specifying the order they should be joined in
  • Method Details

    • getText

      public String getText()
      Get the text of the SQL statement represented.
      Returns:
      String containing the text of the SQL statement represented.
    • getJoinOrder

      public String getJoinOrder()
      Get the join order hint supplied in the constructor.
      Returns:
      String containing the join order hint.
    • isReadOnly

      public boolean isReadOnly()
      Is this a read only statement?
      Returns:
      true if it's read only, false otherwise
    • canonicalizeStmt

      public static String canonicalizeStmt(String stmtStr)
    • setInCatalog

      public void setInCatalog(boolean inCatalog)