com.ibm.as400.access

Class JDEscapeClause

  • java.lang.Object
    • com.ibm.as400.access.JDEscapeClause


  • public class JDEscapeClause
    extends java.lang.Object

    This class represents an escape clause in a SQL statement. It is used to translate SQL statements with JDBC escape syntax to DB2 for IBM i format.

    • Constructor Summary

      Constructors 
      Constructor and Description
      JDEscapeClause() 
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      static java.lang.String parse(com.ibm.as400.access.JDSQLTokenizer tokenizer, java.lang.String decimalSeparator, boolean flag, int vrm)
      Parses an escape clause, and substitute it with native SQL.
      static java.lang.String parse(java.lang.String escapeSyntax, java.lang.String decimalSeparator, int vrm)
      Parses an escape clause, and substitute it with native SQL.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JDEscapeClause

        public JDEscapeClause()
    • Method Detail

      • parse

        public static java.lang.String parse(java.lang.String escapeSyntax,
                             java.lang.String decimalSeparator,
                             int vrm)
                                      throws java.sql.SQLException
        Parses an escape clause, and substitute it with native SQL. This will recursively parse all nested escape clauses.
        Parameters:
        escapeSyntax - SQL escape syntax.
        decimalSeparator - The decimal separator.
        Returns:
        The parsed string.
        Throws:
        java.sql.SQLException - If there is a syntax error or a reference to an unsupported scalar function.
      • parse

        public static java.lang.String parse(com.ibm.as400.access.JDSQLTokenizer tokenizer,
                             java.lang.String decimalSeparator,
                             boolean flag,
                             int vrm)
                                      throws java.sql.SQLException
        Parses an escape clause, and substitute it with native SQL. This will recursively parse all nested escape clauses.

        When the flag is true, the tokenized string is considered to be the entire SQL statement and will end at the end of the string.

        When the flag is false, the tokenized string is considered to be just a single escape clause, starting 1 token after its left brace. It will end at the matching right brace.

        Parameters:
        tokenizer - The tokenized string.
        decimalSeparator - The decimal separator.
        flag - The flag.
        Throws:
        java.sql.SQLException - If there is a syntax error or a reference to an unsupported scalar function.