builds the text of the prepared statement

@param context A ControlBeanContext instance.
@param m The annotated method.
@param args The method's parameters.
@return The PreparedStatement text generated by this fragment and its children.
18217
String getPreparedStatementText(ControlBeanContext context, Method m, Object[] args) {
        StringBuilder sb = new StringBuilder();
        for (SqlFragment sf : _children) {
            sb.append(sf.getPreparedStatementText(context, m, args));
        }
        return sb.toString();
    }
1182191
public static String build(String messageSelector, Map<String, Object> messageSelectorMap, TestContext context) {
        if (StringUtils.hasText(messageSelector)) {
            return context.replaceDynamicContentInString(messageSelector);
        } else if (!CollectionUtils.isEmpty(messageSelectorMap)) {
            return MessageSelectorBuilder.fromKeyValueMap(
                    context.resolveDynamicValuesInMap(messageSelectorMap)).build();
        }

        return "";
    }
556133
final void map(D6Model mModelObj, PreparedStatement preparedStatement, D6Inex includeExcludeColumnNames) throws D6Exception {

        log("#map obj=" + mModelObj);

        final Set<String> columnNameSet = getAllColumnNames();

        // index starts from 1
        int parameterIndex = 1;

        final List<String> columnNameList = new ArrayList<String>(columnNameSet);

        final List<Field> primaryKeyFieldList = getPrimaryKeyFieldList();

        for (Field field : primaryKeyFieldList) {
            DBColumn dbColumn = field.getAnnotation(DBColumn.class);
            String columnName = dbColumn.columnName();
            columnNameList.add(columnName);
        }

        // edit column names corresponding to include/exclude policy
        if (includeExcludeColumnNames != null) {
            includeExcludeColumnNames.manipulate(columnNameList);
        }

        // scan column by column
        for (String columnName : columnNameList) {

            final D6ModelClassFieldInfo fieldInfo = getFieldInfo(columnName);

            final boolean isNullable = fieldInfo.isNullable;

            final Field field = fieldInfo.field;
            final String fieldName = field.getName();

            final Class<?> type = field.getType();

            Object fieldValue = null;

            try {
                fieldValue = field.get(mModelObj);
            } catch (IllegalArgumentException e) {
                throw new D6Exception(e);
            } catch (IllegalAccessException e) {
                throw new D6Exception(e);
            }

            //
            if (fieldValue == null && isNullable == false) {
                // In case found the null-value column,
                // even though this item is NOT NULL
                throw new D6Exception("D6Error the model object field '" + fieldName + "'(column name is " + columnName + ") should not null." + "Because of constraint of table definition.");
            }

            try {

                log("#map idx=" + parameterIndex + " " + columnName + "=" + fieldValue + " (" + type + ")");

                setValue(parameterIndex, preparedStatement, type, fieldValue);

            } catch (Exception e) {
                throw new D6Exception(e);
            }

            parameterIndex++;

        }// end for (String columnName : columnNameList) {

    }
22851
protected boolean hasComplexValue(ControlBeanContext context, Method m, Object[] args) {
        Object val = getParameterValue(context, m, args);
        return val instanceof JdbcControl.ComplexSqlFragment;
    }
215714
@Deprecated
	public static ResultSet query(String sql, Object... args) {
		ResultSet result = null;
		Connection con = getconnnection();
		PreparedStatement ps = null;
		try {
			ps = con.prepareStatement(sql);
			if (args != null) {
				for (int i = 0; i < args.length; i++) {
					ps.setObject((i + 1), args[i]);
				}
			}
			result = ps.executeQuery();
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return result;
	}
121798
static int execute(CallInfo callInfo, DB db, String sql, Object[] args) {
    return db.access(callInfo, () -> {
      db.logSetup(callInfo, sql);
      try (WrappedStatement ws = db.compile(sql)) {
        PreparedStatement stmt = ws.getStatement();
        if (args != null && args.length != 0) {
          for (int i=0; i < args.length; i++) {
            stmt.setObject(i + 1, args[i]);
          }
        }
        stmt.execute();
        return stmt.getUpdateCount();
      }
    });
  }
1210394
private void generateContextHandlerMeta(final Set<Bean<?>> processBeans) {
        for (final Bean<?> latkeBean : processBeans) {
            final Class<?> clz = latkeBean.getBeanClass();
            final Method[] declaredMethods = clz.getDeclaredMethods();
            for (int i = 0; i < declaredMethods.length; i++) {
                final Method method = declaredMethods[i];
                final RequestProcessing requestProcessingMethodAnn = method.getAnnotation(RequestProcessing.class);
                if (null == requestProcessingMethodAnn) {
                    continue;
                }

                final ContextHandlerMeta contextHandlerMeta = new ContextHandlerMeta();
                contextHandlerMeta.setUriTemplates(requestProcessingMethodAnn.value());
                contextHandlerMeta.setHttpMethods(requestProcessingMethodAnn.method());
                contextHandlerMeta.setInvokeHolder(method);
                contextHandlerMeta.initProcessAdvices();

                addContextHandlerMeta(contextHandlerMeta);
            }
        }
    }
1057516
public static PreparedStatement prepareStatementForBatch(Connection conn, String sql, Object[]... paramsBatch) throws SQLException {
		return prepareStatementForBatch(conn, sql, new ArrayIter<Object[]>(paramsBatch));
	}
506681
@Override
	public SqlContext createSqlContext() {
		SqlContextImpl sqlContext = new SqlContextImpl();
		Map<String, Parameter> paramMap = new ConcurrentHashMap<>(getConstParameterMap());

		// 自動バインド用パラメータ生成クラスが指定されている場合は、そこで生成されたパラメータをパラメータマップに追加する
		if (autoBindParameterCreators != null && !autoBindParameterCreators.isEmpty()) {
			for (AutoBindParameterCreator creator : getAutoBindParameterCreators()) {
				Map<String, Parameter> bindMap = creator.getBindParameterMap();
				if (bindMap != null && !bindMap.isEmpty()) {
					paramMap.putAll(bindMap);
				}
			}
		}

		sqlContext.setConstParameterMap(paramMap);
		sqlContext.setSqlFilterManager(getSqlFilterManager());
		sqlContext.setParameterMapperManager(new BindParameterMapperManager(parameterMapperManager));
		sqlContext.setQueryAutoParameterBinder(queryAutoParameterBinder);
		sqlContext.setUpdateAutoParameterBinder(updateAutoParameterBinder);

		return sqlContext;
	}
1194707
public PreparedStatement prepareStatement(final String sql) throws SQLException {
    return internalPrepareStatement(sql,
        ResultSet.TYPE_FORWARD_ONLY,
        ResultSet.CONCUR_READ_ONLY,
        Statement.NO_GENERATED_KEYS);
  }
138933
public static JavacMessages instance(Context context) {
        JavacMessages instance = context.get(messagesKey);
        if (instance == null)
            instance = new JavacMessages(context);
        return instance;
    }
1356496
protected Message createMessage(TestContext context, String messageType) {
        if (dataDictionary != null) {
            messageBuilder.setDataDictionary(dataDictionary);
        }

        return messageBuilder.buildMessageContent(context, messageType, MessageDirection.OUTBOUND);
    }
1265481
public void addBatch(PreparedStatement stmt) throws PlatformException
    {
        // Check for Oracle batching support
        final boolean statementBatchingSupported = m_batchStatementsInProgress.containsKey(stmt);
        if (statementBatchingSupported)
        {
            try
            {
                stmt.executeUpdate();
            }
            catch (SQLException e)
            {
                throw new PlatformException(e.getLocalizedMessage(), e);
            }
        }
        else
        {
            super.addBatch(stmt);
        }
    }
284288
public PreparedStatement prepareStatement(final String sql, 
                                              final int autoGeneratedKeys) 
        throws SQLException {

        checkClosed();

        return new acolyte.jdbc.
            PreparedStatement(this, sql, autoGeneratedKeys, null, null,
                              this.handler.getStatementHandler());

    }
1112673
@Override
	public int[] doBatch(final SqlContext sqlContext, final PreparedStatement preparedStatement, final int[] result) {
		if (LOG.isDebugEnabled()) {
			int[] counts = result;
			try {
				counts = new int[] { preparedStatement.getUpdateCount() };
			} catch (SQLException ex) {
				ex.printStackTrace();
			}

			StringBuilder builder = new StringBuilder();
			for (int val : counts) {
				builder.append(val).append(", ");
			}
			LOG.debug("SQL:{} executed. Result:{}", sqlContext.getSqlName(), builder.toString());
		}
		return result;
	}
865155
private static String buildMessage(String parameterName, String methodName) {

        ResourceBundle rb = ResourceBundle.getBundle("org.apache.beehive.controls.system.jdbc.parser.strings", Locale.getDefault() );
        String pattern = rb.getString("jdbccontrol.invalid.param");
        return MessageFormat.format(pattern, parameterName, methodName);
    }
162594
private static StringBuffer generateBody(MetaEntity entity, Context context) {
		StringWriter sw = new StringWriter();
		PrintWriter pw = null;
		try {
			pw = new PrintWriter( sw );

			if ( context.addGeneratedAnnotation() ) {
				pw.println( writeGeneratedAnnotation( entity, context ) );
			}
			if ( context.isAddSuppressWarningsAnnotation() ) {
				pw.println( writeSuppressWarnings() );
			}

			pw.println( writeStaticMetaModelAnnotation( entity ) );

			printClassDeclaration( entity, pw, context );

			pw.println();

			List<MetaAttribute> members = entity.getMembers();
			for ( MetaAttribute metaMember : members ) {
				pw.println( "	" + metaMember.getDeclarationString() );
			}

			pw.println();
			pw.println( "}" );
			return sw.getBuffer();
		}
		finally {
			if ( pw != null ) {
				pw.close();
			}
		}
	}