<p>
Verify sql is syntactally correct, otherwise a KriptonProcessorException
will be thrown.
</p>

@param jqlContext
the jql context
@param jql
the jql
967171
public void verify(final JQLContext jqlContext, final JQL jql) {
		this.analyzeInternal(jqlContext, jql.value, new JqlBaseListener());
	}
517016
public Stmt prepare( String sql ) throws jsqlite.Exception {
        synchronized (this) {
            Stmt stmt = new Stmt();
            stmt_prepare(sql, stmt);
            return stmt;
        }
    }
619862
@Then("^The Elasticsearch index named '(.+?)' and mapping '(.+?)' contains a column named '(.+?)' with the value '(.+?)'$")
    public void elasticSearchIndexContainsDocument(String indexName, String mappingName, String columnName, String columnValue) throws Exception {
        Assertions.assertThat((commonspec.getElasticSearchClient().searchSimpleFilterElasticsearchQuery(
                indexName,
                mappingName,
                columnName,
                columnValue,
                "equals"
        ).size()) > 0).isTrue().withFailMessage("The index does not contain that document");
    }
1337566
public static final void checkTxAttrs(TransactionAttribute[] txAttrs,
                                          String[] methodNames, String[] methodSignatures,//PQ63130
                                          String[] checkedNames, String[] checkedSignatures,//PQ63130

                                          TransactionAttribute prescribedAttr)
    {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "checkTxAttrs");
        for (int i = 0; i < methodNames.length; ++i) {
            for (int j = 0; j < checkedNames.length; ++j) {

                //PQ63130 added check of method signature
                if (((methodNames[i].equals(checkedNames[j])) && (methodSignatures[i].equals(checkedSignatures[j]))) | checkedNames[j].equals("*")) {

                    txAttrs[i] = prescribedAttr;
                    break;
                }
            }
        }

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "checkTxAttrs");

    }
737884
private static <L extends Annotation> String defineWhereStatement(final SQLiteModelMethod method, final JQL jql, Class<L> annotation, Map<JQLDynamicStatementType, String> dynamicReplace) {
		StringBuilder builder = new StringBuilder();

		String where = AnnotationUtility.extractAsString(method.getElement(), annotation, AnnotationAttributeType.WHERE);
		if (StringUtils.hasText(where))
			jql.annotatedWhere = true;

		if (StringUtils.hasText(where) || method.hasDynamicWhereConditions()) {
			builder.append(" " + WHERE_KEYWORD);

			if (StringUtils.hasText(where)) {
				jql.staticWhereConditions = true;
				builder.append(StringUtils.startWithSpace(where));
			}

			if (StringUtils.hasText(method.dynamicWhereParameterName)) {
				StringBuilder dynamicBuffer = new StringBuilder();
				dynamicBuffer.append(" #{" + JQLDynamicStatementType.DYNAMIC_WHERE + "}");
				builder.append(" #{" + JQLDynamicStatementType.DYNAMIC_WHERE + "}");

				// define replacement string for WHERE
				dynamicReplace.put(JQLDynamicStatementType.DYNAMIC_WHERE, dynamicBuffer.toString());
			}

		}

		return builder.toString();
	}
204586
private static JQL buildJQLDelete(SQLiteModelMethod method, final JQL result, final Map<JQLDynamicStatementType, String> dynamicReplace, String preparedJql) {
		final SQLiteDaoDefinition dao = method.getParent();

		if (StringUtils.hasText(preparedJql)) {
			// in DELETE SQL only where statement can contains bind parameter
			result.value = preparedJql;

			JQLChecker.getInstance().analyze(method, result, new JqlBaseListener() {

				@Override
				public void enterBind_parameter(Bind_parameterContext ctx) {
					result.bindParameterOnWhereStatementCounter++;
				}

				@Override
				public void enterBind_dynamic_sql(Bind_dynamic_sqlContext ctx) {
					JQLDynamicStatementType dynamicType = JQLDynamicStatementType.valueOf(ctx.bind_parameter_name().getText().toUpperCase());

					int start = ctx.getStart().getStartIndex() - 1;
					int stop = ctx.getStop().getStopIndex() + 1;

					String dynamicWhere = result.value.substring(start, stop);

					dynamicReplace.put(dynamicType, dynamicWhere);
				}
			});

			// where management
			JQLChecker.getInstance().replaceVariableStatements(method, preparedJql, new JQLReplaceVariableStatementListenerImpl() {

				@Override
				public String onWhere(String statement) {
					result.annotatedWhere = true;
					result.staticWhereConditions = true;
					return null;
				}
			});

		} else {
			StringBuilder builder = new StringBuilder();
			builder.append(DELETE_KEYWORD + " " + FROM_KEYWORD);
			// entity name
			builder.append(" " + dao.getEntitySimplyClassName());

			builder.append(defineWhereStatement(method, result, BindSqlDelete.class, dynamicReplace));

			result.value = builder.toString();
		}
		result.operationType = JQLType.DELETE;
		result.dynamicReplace = dynamicReplace;
		return result;
	}
829660
public void configureExecutionQuery(AbstractQuery query) {
    configureQuery(query);
    CompositePermissionCheck permissionCheck = new PermissionCheckBuilder()
        .disjunctive()
        .atomicCheck(PROCESS_INSTANCE, "RES.PROC_INST_ID_", READ)
        .atomicCheck(PROCESS_DEFINITION, "P.KEY_", READ_INSTANCE)
        .build();
    addPermissionCheck(query.getAuthCheck(), permissionCheck);
  }
1246373
private void validateQueryResults(String query, N1qlQueryResult result)
    {
        LOGGER.debug("Query output status: " + result.finalSuccess());

        if (!result.finalSuccess())
        {
            StringBuilder errorBuilder = new StringBuilder();
            for (JsonObject obj : result.errors())
            {
                errorBuilder.append(obj.toString());
                errorBuilder.append("\n");
            }
            errorBuilder.deleteCharAt(errorBuilder.length() - 1);
            String errors = errorBuilder.toString();
            LOGGER.error(errors);
            throw new KunderaException("Not able to execute query/statement:" + query + ". More details : " + errors);
        }
    }
818993
private void checkJdbcSupport(DatabaseMetaData metaData) throws SQLException {

        if (_getGeneratedKeys && !metaData.supportsGetGeneratedKeys()) {
            throw new ControlException("The database does not support getGeneratedKeys.");
        }

        if (_batchUpdate && !metaData.supportsBatchUpdates()) {
            throw new ControlException("The database does not support batchUpdates.");
        }

        if (_scrollType != JdbcControl.ScrollType.DRIVER_DEFAULT
                && !metaData.supportsResultSetConcurrency(_scrollType.getType(), _scrollType.getConcurrencyType())) {
            throw new ControlException("The database does not support the ResultSet concurrecy type: " + _scrollType.toString());
        }

        if (_holdability != JdbcControl.HoldabilityType.DRIVER_DEFAULT
                && !metaData.supportsResultSetHoldability(_holdability.getHoldability())) {
            throw new ControlException("The database does not support the ResultSet holdability type: " + _holdability.toString());
        }
    }
518353
@SuppressWarnings("unchecked")
    protected boolean executeSQLStmt(final ISelectionProvider _sqlProvider, final String _complStmt)
        throws EFapsException
    {
        SQLRunner.LOG.debug("SQL-Statement: {}", _complStmt);

        boolean ret = false;
        List<Object[]> rows = new ArrayList<>();

        boolean cached = false;
        if (runnable.has(StmtFlag.REQCACHED)) {
            final QueryKey querykey = QueryKey.get(Context.getThreadContext().getRequestId(), _complStmt);
            final Cache<QueryKey, Object> cache = QueryCache.getSqlCache();
            if (cache.containsKey(querykey)) {
                final Object object = cache.get(querykey);
                if (object instanceof List) {
                    rows = (List<Object[]>) object;
                }
                cached = true;
            }
        }
        if (!cached) {
            ConnectionResource con = null;
            try {
                con = Context.getThreadContext().getConnectionResource();
                final Statement stmt = con.createStatement();
                final ResultSet rs = stmt.executeQuery(_complStmt);
                final ArrayListHandler handler = new ArrayListHandler(Context.getDbType().getRowProcessor());
                rows = handler.handle(rs);
                rs.close();
                stmt.close();
            } catch (final SQLException e) {
                throw new EFapsException(SQLRunner.class, "executeOneCompleteStmt", e);
            }
            if (runnable.has(StmtFlag.REQCACHED)) {
                final ICacheDefinition cacheDefinition = new ICacheDefinition() {

                    @Override
                    public long getLifespan()
                    {
                        return 5;
                    }

                    @Override
                    public TimeUnit getLifespanUnit()
                    {
                        return TimeUnit.MINUTES;
                    }
                };
                QueryCache.put(cacheDefinition, QueryKey.get(Context.getThreadContext().getRequestId(), _complStmt), rows);
            }
        }
        for (final Object[] row : rows) {
            for (final Select select : _sqlProvider.getSelection().getAllSelects()) {
                select.addObject(row);
            }
            ret = true;
        }
        return ret;
    }
1199601
private void checkRelationAndExecuteQuery(String embeddableKey,
            Map<String, List<String>> embeddableToDependentEmbeddables, Map<String, String> queries)
    {
        List<String> dependentEmbeddables = embeddableToDependentEmbeddables.get(embeddableKey);

        if (!dependentEmbeddables.isEmpty())
        {
            for (String dependentEmbeddable : dependentEmbeddables)
            {
                checkRelationAndExecuteQuery(dependentEmbeddable, embeddableToDependentEmbeddables, queries);
            }
        }
        KunderaCoreUtils.printQuery(queries.get(embeddableKey), showQuery);

        try
        {
            cassandra_client.execute_cql3_query(
                    ByteBuffer.wrap(queries.get(embeddableKey).getBytes(Constants.CHARSET_UTF8)), Compression.NONE,
                    ConsistencyLevel.ONE);
        }
        catch (Exception e)
        {
            throw new KunderaException("Error while creating type: " + queries.get(embeddableKey), e);
        }

    }
28236
public boolean execUpdateByRawSQL(String updateRawSQL) {

    boolean retVal = false;

    log("#execUpdateByRawSQL updateRawSQL=" + updateRawSQL);

    final Connection conn = createConnection();

    try {

      Statement stmt = null;

      // There is a possibility that the error occurs in one single update
      // statement.
      // Therefore, turn the auto commit off.
      conn.setAutoCommit(false);

      stmt = conn.createStatement();
      stmt.executeUpdate(updateRawSQL);

      // finally,commit
      conn.commit();

      retVal = true;

    } catch (SQLException e) {

      loge("#execUpdateByRawSQL", e);
      retVal = false;

    } finally {

      try {
        conn.close();
      } catch (SQLException e) {
        retVal = false;
        loge("#execUpdateByRawSQL", e);
      }
    }
    return retVal;

  }
329884
VoltXMLElement voltGetStatementXML(Session session)
    throws org.hsqldb_voltpatches.HSQLInterface.HSQLParseException
    {
        throw new org.hsqldb_voltpatches.HSQLInterface.HSQLParseException(
                "this type of sql statement is not supported or is not allowed in this context");
    }
1229690
@Deprecated
    public C verifyAtMost(int allowedStatements, Threads threadMatcher) throws WrongNumberOfQueriesError {
        return verify(SqlQueries.maxQueries(allowedStatements).threads(threadMatcher));
    }
927348
@Override
    public void register(BindingRegisterContext<JsonArray> ctx) throws SQLException {
        ctx.statement().registerOutParameter(ctx.index(), Types.VARCHAR);
    }
665739
public void setSql(String sql) {
		if (StringUtils.isNotEmpty(sql)) {
			this.sql = sql.trim();
			this.comment = parseComment(sql);
			this.digest = MessageDigestUtils.MD5(sql);
			
			String sqlStatement = this.sql.toLowerCase();
			if (sqlStatement != null) {
				this.select = sqlStatement.startsWith("select");
				this.procedure = sqlStatement.startsWith("call");
			}
		}
	}
860106
private static void handleSQLException(SQLException e, String poolName, String sql) {

    YankSQLException yankSQLException = new YankSQLException(e, poolName, sql);

    if (throwWrappedExceptions) {
      throw yankSQLException;
    } else {
      logger.error(yankSQLException.getMessage(), yankSQLException);
    }
  }