Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/399.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 为spring批处理使用两个不同的数据库_Java_Spring Batch Admin - Fatal编程技术网

Java 为spring批处理使用两个不同的数据库

Java 为spring批处理使用两个不同的数据库,java,spring-batch-admin,Java,Spring Batch Admin,*我想在spring管理批处理作业中配置两个不同的数据库。但在运行应用程序时,只有“POSTGRES”数据库得到配置。是否可以为spring批处理应用程序配置2 diff DB。 我为这两个数据库都添加了属性。它正在配置并运行应用程序。但是当我试图从不同的数据库(辅助数据库)获取数据时。因此,它无法映射表 batch.jdbc.url=jdbc:postgresql://localhost:5432/glow batch.jdbc.driver=org.postgresql.Driver bat

*我想在spring管理批处理作业中配置两个不同的数据库。但在运行应用程序时,只有“POSTGRES”数据库得到配置。是否可以为spring批处理应用程序配置2 diff DB。 我为这两个数据库都添加了属性。它正在配置并运行应用程序。但是当我试图从不同的数据库(辅助数据库)获取数据时。因此,它无法映射表

batch.jdbc.url=jdbc:postgresql://localhost:5432/glow
batch.jdbc.driver=org.postgresql.Driver
batch.jdbc.user=postgres
batch.jdbc.password=postgres
travel.batch.jdbc.driver=com.mysql.jdbc.Driver
travel.batch.jdbc.url=jdbc:mysql://localhost:3306/travel
travel.batch.jdbc.user=root
travel.batch.jdbc.password=root

我想配置并连接到两个数据库在spring admin批处理作业项目中为不同的批处理作业从两个数据库中获取数据*

在spring批处理应用程序中,两个数据库一次未配置,只有1db可以连接,尽管它可以同时连接多个属性到数据库,但只有一个数据库可以连接,并且经过验证。在SpringBoot应用程序中,可以一次连接多个数据库,但不能在SpringBatch中连接

您遇到了什么错误?无法映射辅助数据库的两个表,但我在配置第二个数据库时没有遇到错误,原因是:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:Table'glow.pod_notification'不存在您可以在管理视图或类似的视图中看到该表吗?你确定它存在吗?我没有通过管理员视图获取,该表存在于另一个“TRAVEL”数据库中,并且默认情况下只有batch.jdbc.url=jdbc:postgresql://localhost:5432/glow batch.jdbc.driver=org.postgresql.driver batch.jdbc.user=postgres batch.jdbc.password=postgres上述属性在以“batch.jdbc…”开头时被启用@ArnaudClaudel是否可以使用两个数据库来管理spring批处理?只需按照spring Boot的方式执行即可。boot为您提供的所有功能都是自动配置,因此您可以在非启动应用程序中手动执行相同的操作。@jinit bansod我可以从一个数据库检索数据并使用springbatch将其保存到另一个数据库中吗?