Performs a SQL query.

@param sql the sql query
339843
protected void runSQL(String sql) {
		try {
			DataSource dataSource = commerceWarehousePersistence.getDataSource();

			DB db = DBManagerUtil.getDB();

			sql = db.buildSQL(sql);
			sql = PortalUtil.transformSQL(sql);

			SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
					sql);

			sqlUpdate.update();
		}
		catch (Exception e) {
			throw new SystemException(e);
		}
	}
1250373
protected function query ( $sql )
	{
		$sql = $this->sql_printf(func_get_args());
		if (!($res = mysqli_query( $this->conn, $sql)))
		{
			$this->sql_errcheck($sql);
		}
		if (!is_bool($res))
		{
			((mysqli_free_result($res) || (is_object($res) && (get_class($res) == "mysqli_result"))) ? true : false);
		}
	}
760020
@Override
    public boolean execute(String sql) throws SQLException
    {
        checkClosed();
        VoltSQL query = VoltSQL.parseSQL(sql);
        return this.execute(query);
    }
988620
protected void executeSQL(String sql){
		Connection conn = null;
		Statement stmt = null;
		
		if (useAnt){
			try{
				AntSqlExec sqlExec = new AntSqlExec(dataSource, sql, delimiter, delimiterType);
				sqlExec.execute();
				log.info("SQL executed with Ant: " + sql);
			}catch(BuildException be){
				throw new RuntimeException("Failed to execute SQL with Ant (" + be.getMessage() + "): " + sql, be);
			}
		}else{
			try {
				conn = dataSource.getConnection();
				stmt = conn.createStatement();
				stmt.execute(sql);
				log.info("SQL executed: " + sql);
			}catch(SQLException sqle){
				throw new RuntimeException("Failed to execute SQL (" + sqle.getMessage() + "): " + sql, sqle);
			}finally{
				ConnectionUtility.closeConnection(conn, stmt);
			}
		}
	}
805111
public Object querySingleResult(String sql, String[] args, int column) {
		return db.querySingleResult(sql, args, column);
	}
848455
public QueryAction explain(String sql) throws SqlParseException, SQLFeatureNotSupportedException {
		return ESActionFactory.create(client, sql);
	}
39325
public void execute(String query, Object... params) throws SQLException {
        createPreparedStatement(query, 0, params).execute();
    }
649516
public static void execute(final Connection connection, final String sql) throws SQLException {
        try (PreparedStatement preparedStatement = connection.prepareStatement(sql)){
            preparedStatement.execute();
        }
    }
1047928
public int execute(String sql, Object... params) {
        Connection conn = getConn();
        try {
            return conn.createQuery(sql)
                    .withParams(params)
                    .executeUpdate()
                    .getResult();
        } finally {
            this.closeConn(conn);
            this.clean(conn);
        }
    }
687080
public int execute(String sql, List<Object> params) {
        return this.execute(sql, params.toArray());
    }
510122
private void executeStatement(String statement) throws SQLException {
		logger.entering(CLASSNAME, "executeStatement", statement);

		Connection conn = getConnection();
		PreparedStatement ps = null;

		ps = conn.prepareStatement(statement);
		ps.executeUpdate();

		cleanupConnection(conn, ps);
		logger.exiting(CLASSNAME, "executeStatement");
	}
438629
public int queryForInt(String sql) throws SQLException {
		Number number = queryForObject(sql, Integer.class);
		return (number != null ? number.intValue() : 0);
	}
1156780
@Deprecated
    void execute(String sql, Object... parameters) {
        if (N.isNullOrEmpty(parameters)) {
            sqliteDB.execSQL(sql);
        } else {
            final NamedSQL namedSQL = parseSQL(sql);
            final Object[] args = prepareArguments(namedSQL, parameters);
            sqliteDB.execSQL(namedSQL.getPureSQL(), args);
        }
    }
1316803
public void executeQuery(String query, Optional<String> proxy)
      throws SQLException {
    executeQueries(Collections.singletonList(query), proxy);
  }
485402
@Override
    void reset(String sql) {

        super.reset(sql);
        compileContext.reset();

        lastError = null;
    }
1212412
protected function query ( $sql )
	{
		$sql = $this->sql_printf(func_get_args());
		if (!($res = mysql_query($sql, $this->conn)))
		{
			$this->sql_errcheck($sql);
		}
		if (is_resource($res))
		{
			mysql_free_result($res);
		}
	}
758075
@Override
    public boolean execute( String sql ) throws SQLException {
        notClosed();
        warning = null;
        moreResults = 0;
        try {
            // Convert the supplied SQL into JCR-SQL2 ...
            String jcrSql2 = connection.nativeSQL(sql);
            // Create the query ...
            final QueryResult jcrResults = getJcrRepositoryDelegate().execute(jcrSql2, this.sqlLanguage);
            results = new JcrResultSet(this, jcrResults, null);
            moreResults = 1;
        } catch (RepositoryException e) {
            throw new SQLException(e.getLocalizedMessage(), e);
        }
        return true; // always a ResultSet
    }