{@inheritDoc}

@see jp.co.future.uroborosql.client.command.ReplCommand#execute(org.jline.reader.LineReader, java.lang.String[], jp.co.future.uroborosql.config.SqlConfig, java.util.Properties)
491463
@Override
	public boolean execute(final LineReader reader, final String[] parts, final SqlConfig sqlConfig,
			final Properties props) {
		PrintWriter writer = reader.getTerminal().writer();

		String tableNamePattern = parts.length > 1 ? parts[parts.length - 1] : "%";

		try {
			Connection conn = sqlConfig.getConnectionSupplier().getConnection();
			DatabaseMetaData md = conn.getMetaData();

			List<Map<String, String>> columns = new ArrayList<>();
			Map<String, Integer> labelLength = new HashMap<>();
			for (String label : DESC_COLUMN_LABELS) {
				labelLength.put(label, label.length());
			}
			try (ResultSet rs = md.getColumns(conn.getCatalog(), conn.getSchema(), tableNamePattern, null)) {
				while (rs.next()) {
					Map<String, String> column = new HashMap<>();
					for (String label : DESC_COLUMN_LABELS) {
						final String value = StringUtils.defaultString(rs.getString(label));
						column.put(label, value);
						labelLength.compute(
								label,
								(k, v) -> v == null ? getByteLength(value)
										: v.compareTo(getByteLength(value)) >= 0 ? v : getByteLength(value));
					}
					columns.add(column);
				}
			}

			// ラベル
			writer.print("-");
			for (String label : DESC_COLUMN_LABELS) {
				writer.print(StringUtils.rightPad("", labelLength.get(label), "-"));
				writer.print("-");
			}
			writer.println();
			writer.print("|");
			for (String label : DESC_COLUMN_LABELS) {
				writer.print(StringUtils.rightPad(label, labelLength.get(label)));
				writer.print("|");
			}
			writer.println();
			// カラムデータ
			String tableName = null;
			boolean breakFlag = false;
			for (Map<String, String> column : columns) {
				if (tableName == null || !tableName.equalsIgnoreCase(column.get("TABLE_NAME"))) {
					tableName = column.get("TABLE_NAME");
					breakFlag = true;
				}
				if (breakFlag) {
					writer.print("-");
					for (String label : DESC_COLUMN_LABELS) {
						writer.print(StringUtils.rightPad("", labelLength.get(label), "-"));
						writer.print("-");
					}
					writer.println();
					breakFlag = false;
				}

				writer.print("|");
				for (String label : DESC_COLUMN_LABELS) {
					String val = column.get(label);
					if (StringUtils.isNumeric(val)) {
						writer.print(StringUtils.leftPad(val, labelLength.get(label)));
					} else {
						writer.print(StringUtils.rightPad(val, labelLength.get(label)));
					}
					writer.print("|");
				}
				writer.println();
			}
			writer.print("-");
			for (String label : DESC_COLUMN_LABELS) {
				writer.print(StringUtils.rightPad("", labelLength.get(label), "-"));
				writer.print("-");
			}
			writer.println();
		} catch (SQLException ex) {
			ex.printStackTrace();
		}
		writer.flush();

		return true;
	}
1184860
public void execute() throws BuildException
    {
        if ((_commands == null) || (_commands.length() == 0))
        {
            return;
        }

        DBHandling handling = createDBHandling();

        try
        {
            if ((_workDir != null) && (_workDir.length() > 0))
            {
                handling.setWorkDir(_workDir);
                System.setProperty("user.dir", _workDir);
            }
            for (Iterator it = _fileSets.iterator(); it.hasNext();)
            {
                addIncludes(handling, (FileSet)it.next());
            }

            if ((_propertiesFile != null) && (_propertiesFile.length() > 0))
            {
                System.setProperty("OJB.properties", _propertiesFile);
            }

            ConnectionRepository connRep = MetadataManager.getInstance().connectionRepository();
            PBKey                pbKey   = null;

            if ((_jcdAlias == null) || (_jcdAlias.length() == 0))
            {
                pbKey = PersistenceBrokerFactory.getDefaultKey();
            }
            else
            {
                pbKey = connRep.getStandardPBKeyForJcdAlias(_jcdAlias);
                if (pbKey == null)
                {
                    throw new BuildException("Undefined jcdAlias "+_jcdAlias);
                }
            }
            handling.setConnection(connRep.getDescriptor(pbKey));

            String command;

            for (StringTokenizer tokenizer = new StringTokenizer(_commands, ","); tokenizer.hasMoreTokens();)
            {
                command = tokenizer.nextToken().toLowerCase().trim();
                if (COMMAND_CREATE.equals(command))
                {
                    handling.createDB();
                }
                else if (COMMAND_INIT.equals(command))
                {
                    handling.initDB();
                }
                else
                {
                    throw new BuildException("Unknown command "+command);
                }
            }
        }
        catch (Exception ex)
        {
            throw new BuildException(ex);
        }
    }
379612
public void execute(String name, Reader sqlCode, PrintWriter out) throws Exception {
        runScript(name, sqlCode, out);
    }
272138
public void runSql( String sql ) throws Exception {
        String[] sqlSplit = sql.split("\n");
        StringBuilder sb = new StringBuilder();
        for( String string : sqlSplit ) {
            String trim = string.trim();
            if (trim.length() == 0) {
                continue;
            }
            if (trim.startsWith("--")) {
                continue;
            }
            sb.append(trim + " ");
        }

        String[] sqls = sb.toString().split(";");
        for( String single : sqls ) {
            executeInsertUpdateDeleteSql(single);
        }
    }
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();
        }
    }
244719
public void execute(String statement) throws SQLException {
		if (logger.isDebugEnabled()) {
			logger.debug("Executing SQL statement [" + statement + "]");
		}
		
		Connection connection = null;
		Statement stm = null;
		
		try{
			connection = ds.getConnection();
			stm = connection.createStatement();			
			stm.execute(statement);
		} catch (SQLException e) {
			throw e;
		}finally{
			if(stm!=null) stm.close();
			if(connection!=null) connection.close();			
		}
				
	}
1177572
protected PreparedStatement executeSqlFromScript(String script,
    MapSqlParameterSource args)
  {
    File fScript = new File(scriptPath, script);
    if (fScript.canRead() && fScript.isFile())
    {
      Resource resource = new FileSystemResource(fScript);
      log.debug("executing SQL script: " + resource.getFilename());
      String sql = readSqlFromResource(resource);
      return executeSql(sql, args);
    }
    else
    {
      log.debug("SQL script " + fScript.getName() + " does not exist");
      return null;
    }
  }
223869
@Override
    public ResultSet executeQuery(String sql) throws SQLException
    {
        checkClosed();
        VoltSQL query = VoltSQL.parseSQL(sql);
        if (!query.isOfType(VoltSQL.TYPE_SELECT)) {
            throw SQLError.get(SQLError.ILLEGAL_STATEMENT, sql);
        }
        return this.executeQuery(query);
    }
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);
        }
    }
520597
public static void executeSQL(final SQLiteDatabase database, InputStream fileInputStream) {
		List<String> commands = readSQLFromFile(fileInputStream);
		executeSQL(database, commands);
	}
694467
public boolean execute(final String query) throws SQLException {
        startTimer();
        try {
            if (queryResult != null) {
                queryResult.close();
            }
            queryResult = protocol.executeQuery(queryFactory.createQuery(query));
            if (queryResult.getResultSetType() == ResultSetType.SELECT) {
                setResultSet(new DrizzleResultSet(queryResult, this, getProtocol()));
                return true;
            }
            setUpdateCount(((ModifyQueryResult) queryResult).getUpdateCount());
            return false;
        } catch (QueryException e) {
            throw SQLExceptionMapper.get(e);
        } finally {
            stopTimer();
        }
    }
1221297
public static void main(final String... args) {
		((Logger) LoggerFactory.getLogger("jp.co.future.uroborosql")).setLevel(Level.DEBUG);
		((Logger) LoggerFactory.getLogger("jp.co.future.uroborosql.client")).setLevel(Level.ERROR);
		((Logger) LoggerFactory.getLogger("jp.co.future.uroborosql.context")).setLevel(Level.ERROR);
		((Logger) LoggerFactory.getLogger("jp.co.future.uroborosql.store")).setLevel(Level.ERROR);

		String propFile = "repl.properties";
		if (args.length != 0) {
			propFile = args[0];
		}

		Path path = Paths.get(propFile);

		if (!Files.exists(path)) {
			throw new IllegalArgumentException("properties could not found.");
		}

		try {
			SqlREPL repl = new SqlREPL(path);
			repl.execute();
		} catch (Exception ex) {
			throw new IllegalStateException("Failed to REPL.", ex);
		}
	}
96203
private Object executeExp(PageContext pc, SQL sql, Query qr, ZExp exp, int row) throws PageException {
	if (exp instanceof ZConstant) return executeConstant(sql, qr, (ZConstant) exp, row);
	else if (exp instanceof ZExpression) return executeExpression(pc, sql, qr, (ZExpression) exp, row);
	throw new DatabaseException("unsupported sql statement [" + exp + "]", null, sql, null);

    }
811300
public int execute(int sqlId, Map<String, ? extends Object> bindParams) {
      String sql = context.getResources().getString(sqlId);
      return execute(sql, bindParams);
   }
821868
void execute() {

        String sCmd = null;

        if (4096 <= ifHuge.length()) {
            sCmd = ifHuge;
        } else {
            sCmd = txtCommand.getText();
        }

        if (sCmd.startsWith("-->>>TEST<<<--")) {
            testPerformance();

            return;
        }

        String[] g = new String[1];

        lTime = System.currentTimeMillis();

        try {
            if (sStatement == null) {
                return;
            }

            sStatement.execute(sCmd);

            lTime = System.currentTimeMillis() - lTime;

            int r = sStatement.getUpdateCount();

            if (r == -1) {
                formatResultSet(sStatement.getResultSet());
            } else {
                g[0] = "update count";

                gResult.setHead(g);

                g[0] = String.valueOf(r);

                gResult.addRow(g);
            }

            addToRecent(txtCommand.getText());
        } catch (SQLException e) {
            lTime = System.currentTimeMillis() - lTime;
            g[0]  = "SQL Error";

            gResult.setHead(g);

            String s = e.getMessage();

            s    += " / Error Code: " + e.getErrorCode();
            s    += " / State: " + e.getSQLState();
            g[0] = s;

            gResult.addRow(g);
        }

        updateResult();
        System.gc();
    }
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);
			}
		}
	}