| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private QueryInfo | |
| private int | |
| private static final String | |
| private boolean | |
| private String | |
| private static final String | |
| private boolean | |
| private static final String | |
| private static final String | |
| private static final String | |
| private int | |
| private int | |
| private static final String[] | |
| private static final String | |
| private static final String | |
| private static final String | |
| private List | |
| private int | |
| private QueryReturnType | |
| private int | |
| private static final String | |
| private static final String | |
| private String | |
| private char | |
| private String | |
| private byte[][] | |
| private static final String | |
| private static final String | |
| private int | |
| private ArrayList |
| Access | Constructor and Description |
|---|---|
| public | QueryInfo(String
the query SQL string to parse and analyze sql, Session the session, String Session under which the query analysis must be done.the characters encoding to use when extracting the query static parts as byte arrays. encoding)Constructs a |
| private | QueryInfo(QueryInfo
the baseQueryInfo, int QueryInfo instance that provides the query static parts used to create the new instance now augmented to accommodate the extra
number of parametersthe number of batches, i.e., the number of times the VALUES clause needs to be repeated inside the new query batchCount)Constructs a |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if the query or any of the original queries contain an ON DUPLICATE KEY UPDATE clause.Does this query info represent a query that contains an ON DUPLICATE KEY UPDATE clause? |
| public static boolean | Returns: true if the query contains an ON DUPLICATE KEY UPDATE clause, false otherwisethe query to search sql, boolean whether backslash escapes are disabled or not. noBackslashEscapes)Checks whether the specified SQL contains or not an ON DUPLICATE KEY UPDATE clause. |
| public static char | Returns: the first character of the query, in upper casethe query to search sql, boolean whether backslash escapes are disabled or not noBackslashEscapes)Finds and returns the first non-whitespace character from the specified SQL, skipping comments and quoted text. |
| private static String | Returns: the context of the WITH statement or null if failed to find itthe query to search sql, boolean whether backslash escapes are disabled or not noBackslashEscapes)Returns the context of the WITH statement. |
| public char | Returns: the first character of the statementReturns the first character of the statement from the query used to build this |
| public int | Returns: the number of placeholders in the queryReturns the number of placeholders found in the query. |
| public int | Returns: the number of queries identified in the original SQL stringReturns the number of queries identified in the original SQL string. |
| public List | Returns: the list of the placeholders purposes.Returns a list containing the purpose of each one of the placeholders found according to their positional ordering. |
| public QueryInfo | Returns: QueryInfothe number of parameter batches count)Returns a |
| public QueryReturnType | Returns: the return type of the parsed queryReturns the return type of the parsed query. |
| public static QueryReturnType | Returns: the return type that can be expected from the given query, one of the elements ofQueryReturnType.the query to check sql, boolean whether backslash escapes are disabled or not noBackslashEscapes)Returns the type of return that can be expected from executing the given query. |
| public String | Returns: a preparable query string with the appropriate number of placeholdersReturns a preparable query for the batch count of this |
| public String | Returns: a preparable query string with the appropriate number of placeholdersnumber of parameter batches count)Returns a preparable query for the specified batch count. |
| public String | Returns: the statement keywordReturns the statement keyword from the query used to build this |
| public static String | Returns: the statement keyword of the querythe query to search sql, boolean whether backslash escapes are disabled or not noBackslashEscapes)Finds and returns the statement keyword from the specified SQL, skipping comments and quoted text. |
| public byte[][] | Returns: the static sections of the parsed query, as byte arrays, split by the places where the placeholders were locatedReturns the static sections of the parsed query, as byte arrays, split by the places where the placeholders were located. |
| public int | Returns: the length of the parsed VALUES clause section, including the placeholder characters themselves, otherwise returns -1If this object represents a query that is re-writable as a multi-values statement and if rewriting batched statements is enabled, then returns the length of the parsed VALUES clause section, including the placeholder characters themselves, otherwise returns -1. |
| public static int | Returns: the position of the first character of the querythe query to search sql, boolean whether backslash escapes are disabled or not noBackslashEscapes)Finds and returns the position of the first non-whitespace character from the specified SQL, skipping comments and quoted text. |
| public static boolean | Returns: true if the query is read-only safe, false otherwise.the query to check sql, boolean whether backslash escapes are disabled or not noBackslashEscapes)Checks whether the given query is safe to run in a read-only session. |
| public boolean | Returns: true if the query can be rewritten as a multi-values query.Can this query be rewritten as a multi-values clause? |
| AS_CLAUSE | back to summary |
|---|---|
| private static final String AS_CLAUSE | |
| baseQueryInfo | back to summary |
|---|---|
| private QueryInfo baseQueryInfo | |
| batchCount | back to summary |
|---|---|
| private int batchCount | |
| CLOSING_MARKERS | back to summary |
|---|---|
| private static final String CLOSING_MARKERS | |
| containsOnDuplicateKeyUpdate | back to summary |
|---|---|
| private boolean containsOnDuplicateKeyUpdate | |
| encoding | back to summary |
|---|---|
| private String encoding | |
| INSERT_STATEMENT | back to summary |
|---|---|
| private static final String INSERT_STATEMENT | |
| isRewritableWithMultiValuesClause | back to summary |
|---|---|
| private boolean isRewritableWithMultiValuesClause | |
| LAST_INSERT_ID_FUNC | back to summary |
|---|---|
| private static final String LAST_INSERT_ID_FUNC | |
| LIMIT_CLAUSE | back to summary |
|---|---|
| private static final String LIMIT_CLAUSE | |
| MULTIPLE_QUERIES_TAG | back to summary |
|---|---|
| private static final String MULTIPLE_QUERIES_TAG | |
| numberOfPlaceholders | back to summary |
|---|---|
| private int numberOfPlaceholders | |
| numberOfQueries | back to summary |
|---|---|
| private int numberOfQueries | |
| ODKU_CLAUSE | back to summary |
|---|---|
| private static final String[] ODKU_CLAUSE | |
| OFFSET_CLAUSE | back to summary |
|---|---|
| private static final String OFFSET_CLAUSE | |
| OPENING_MARKERS | back to summary |
|---|---|
| private static final String OPENING_MARKERS | |
| OVERRIDING_MARKERS | back to summary |
|---|---|
| private static final String OVERRIDING_MARKERS | |
| placeholderPurposes | back to summary |
|---|---|
| private List<PlaceholderPurpose> placeholderPurposes | |
| queryLength | back to summary |
|---|---|
| private int queryLength | |
| queryReturnType | back to summary |
|---|---|
| private QueryReturnType queryReturnType | |
| queryStartPos | back to summary |
|---|---|
| private int queryStartPos | |
| REPLACE_STATEMENT | back to summary |
|---|---|
| private static final String REPLACE_STATEMENT | |
| SELECT_STATEMENT | back to summary |
|---|---|
| private static final String SELECT_STATEMENT | |
| sql | back to summary |
|---|---|
| private String sql | |
| statementFirstChar | back to summary |
|---|---|
| private char statementFirstChar | |
| statementKeyword | back to summary |
|---|---|
| private String statementKeyword | |
| staticSqlParts | back to summary |
|---|---|
| private byte[][] staticSqlParts | |
| TABLE_STATEMENT | back to summary |
|---|---|
| private static final String TABLE_STATEMENT | |
| VALUE_CLAUSE | back to summary |
|---|---|
| private static final String VALUE_CLAUSE | |
| valuesClauseLength | back to summary |
|---|---|
| private int valuesClauseLength | |
| valuesEndpoints | back to summary |
|---|---|
| private ArrayList<Integer> valuesEndpoints | |
| QueryInfo | back to summary |
|---|---|
| public QueryInfo(String sql, Session session, String encoding) Constructs a | |
| QueryInfo | back to summary |
|---|---|
| private QueryInfo(QueryInfo baseQueryInfo, int batchCount) Constructs a
| |
| containsOnDuplicateKeyUpdate | back to summary |
|---|---|
| public boolean containsOnDuplicateKeyUpdate() Does this query info represent a query that contains an ON DUPLICATE KEY UPDATE clause? This operation does not take into consideration the multiplicity of queries in the original SQL. Checking whether the original query contains an ON DUPLICATE KEY UPDATE clause is conditional to how the connection properties 'dontCheckOnDuplicateKeyUpdateInSQL' and 'rewriteBatchedStatements' are set, with 'rewriteBatchedStatements=true' implicitly disabling 'dontCheckOnDuplicateKeyUpdateInSQL'.
| |
| containsOnDuplicateKeyUpdateClause | back to summary |
|---|---|
| public static boolean containsOnDuplicateKeyUpdateClause(String sql, boolean noBackslashEscapes) Checks whether the specified SQL contains or not an ON DUPLICATE KEY UPDATE clause. This operation does not take into consideration the multiplicity of queries in the specified SQL.
| |
| firstCharOfStatementUc | back to summary |
|---|---|
| public static char firstCharOfStatementUc(String sql, boolean noBackslashEscapes) Finds and returns the first non-whitespace character from the specified SQL, skipping comments and quoted text.
| |
| getContextForWithStatement | back to summary |
|---|---|
| private static String getContextForWithStatement(String sql, boolean noBackslashEscapes) Returns the context of the WITH statement. The context can be: SELECT, TABLE, VALUES, UPDATE or DELETE. This operation does not take into consideration the multiplicity of queries in the specified SQL. | |
| getFirstStmtChar | back to summary |
|---|---|
| public char getFirstStmtChar() Returns the first character of the statement from the query used to build this
| |
| getNumberOfPlaceholders | back to summary |
|---|---|
| public int getNumberOfPlaceholders() Returns the number of placeholders found in the query.
| |
| getNumberOfQueries | back to summary |
|---|---|
| public int getNumberOfQueries() Returns the number of queries identified in the original SQL string. Different queries are identified by the presence of the query delimiter character, i.e., a semicolon.
| |
| getPlaceholderPurposes | back to summary |
|---|---|
| public List Returns a list containing the purpose of each one of the placeholders found according to their positional ordering.
| |
| getQueryInfoForBatch | back to summary |
|---|---|
| public QueryInfo getQueryInfoForBatch(int count) Returns a | |
| getQueryReturnType | back to summary |
|---|---|
| public QueryReturnType getQueryReturnType() Returns the return type of the parsed query. This operation does not take into consideration the multiplicity of queries in the specified SQL.
| |
| getQueryReturnType | back to summary |
|---|---|
| public static QueryReturnType getQueryReturnType(String sql, boolean noBackslashEscapes) Returns the type of return that can be expected from executing the given query. This operation does not take into consideration the multiplicity of queries in the specified SQL.
| |
| getSqlForBatch | back to summary |
|---|---|
| public String getSqlForBatch() Returns a preparable query for the batch count of this
| |
| getSqlForBatch | back to summary |
|---|---|
| public String getSqlForBatch(int count) Returns a preparable query for the specified batch count.
| |
| getStatementKeyword | back to summary |
|---|---|
| public String getStatementKeyword() Returns the statement keyword from the query used to build this
| |
| getStatementKeyword | back to summary |
|---|---|
| public static String getStatementKeyword(String sql, boolean noBackslashEscapes) Finds and returns the statement keyword from the specified SQL, skipping comments and quoted text. | |
| getStaticSqlParts | back to summary |
|---|---|
| public byte[][] getStaticSqlParts() Returns the static sections of the parsed query, as byte arrays, split by the places where the placeholders were located.
| |
| getValuesClauseLength | back to summary |
|---|---|
| public int getValuesClauseLength() If this object represents a query that is re-writable as a multi-values statement and if rewriting batched statements is enabled, then returns the length of the parsed VALUES clause section, including the placeholder characters themselves, otherwise returns -1.
| |
| indexOfStatementKeyword | back to summary |
|---|---|
| public static int indexOfStatementKeyword(String sql, boolean noBackslashEscapes) Finds and returns the position of the first non-whitespace character from the specified SQL, skipping comments and quoted text.
| |
| isReadOnlySafeQuery | back to summary |
|---|---|
| public static boolean isReadOnlySafeQuery(String sql, boolean noBackslashEscapes) Checks whether the given query is safe to run in a read-only session. In case of doubt it is assumed to be safe. This operation does not take into consideration the multiplicity of queries in the specified SQL.
| |
| isRewritableWithMultiValuesClause | back to summary |
|---|---|
| public boolean isRewritableWithMultiValuesClause() Can this query be rewritten as a multi-values clause?
| |