Postgresql 带有postgres数据源的Apache Camel Wildfly Camel修补程序4.6.0

Postgresql 带有postgres数据源的Apache Camel Wildfly Camel修补程序4.6.0,postgresql,apache-camel,wildfly,Postgresql,Apache Camel,Wildfly,我在apache camel应用程序中使用Postgres数据源时遇到问题。 我使用wildfly 10.1.0和wildfly camel patch 4.6.0 当我执行以下代码时,postgresd是postgres的数据源,在wildfly中配置,db的字符串是 “从测试表中选择*,其中id=?” 当我运行数据源为h2数据库的代码时,db的字符串为 “从id=1的testtable中选择*” 为什么??我如何才能让camel sql与postgres和wildfly一起工作 public

我在apache camel应用程序中使用Postgres数据源时遇到问题。 我使用wildfly 10.1.0和wildfly camel patch 4.6.0

当我执行以下代码时,postgresd是postgres的数据源,在wildfly中配置,db的字符串是

“从测试表中选择*,其中id=?”

当我运行数据源为h2数据库的代码时,db的字符串为

“从id=1的testtable中选择*”

为什么??我如何才能让camel sql与postgres和wildfly一起工作

public class MyRouteBuilder extends RouteBuilder {
    @Resource(name = "java:jboss/datasources/PostgresDS")
    DataSource dataSource;

    @Produces
    @Named("testDS")
    public DataSource getDataSource() {
        return dataSource;
    }
    @Override
    public void configure() throws Exception {

        from("direct:start")
                .setHeader("myId",constant(1))
                .to("sql:select * from test where id=:#myId?dataSource=testDS")
                .to("log:stream:${body}");
    }
}

是否有错误消息。你的问题有点含糊。我使用PG运行ApacheCamel,这两个批次之间没有太大区别。。。其中id=1。你的问题没有详细说明发生了什么,你不理解/错了什么等等。