数据库配置仍在进行中。M6 的目标是让您在 xd-config.yml 中指定的内容来控制 Spring Batch 存储库表和使用 JDBC 的批处理作业的默认值。
在 M5 中有单独的设置来控制它。Spring Batch 存储库使用 config/xd-config.yml 中的内容,而您启动的批处理作业取决于 config/batch-jdbc.properties。为了对两者都使用 MySQL,我进行了更改:
配置/xd-config.yml
#Config for use with MySQL - uncomment and edit with relevant values for your environment
spring:
datasource:
url: jdbc:mysql://localhost:3306/xd
username: spring
password: password
driverClassName: com.mysql.jdbc.Driver
profiles:
active: default,mysql
配置/批处理-jdbc.properties
# Setting for the JDBC batch import job module
url=jdbc:mysql://localhost:3306/xd
username=spring
password=password
driverClass=com.mysql.jdbc.Driver
# Whether to initialize the database on job creation, and the script to
# run to do so if initializeDatabase is true.
initializeDatabase=false
initializerScript=init_batch_import.sql