138.8. Camel SQL Starter
spring 引导用户提供了一个初学者模块。使用初学者时,可以使用 spring-boot 属性直接配置 DataSource。
# Example for a mysql datasource spring.datasource.url=jdbc:mysql://localhost/test spring.datasource.username=dbuser spring.datasource.password=dbpass spring.datasource.driver-class-name=com.mysql.jdbc.Driver
# Example for a mysql datasource
spring.datasource.url=jdbc:mysql://localhost/test
spring.datasource.username=dbuser
spring.datasource.password=dbpass
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
要使用这个功能,请在 spring boot pom.xml 文件中添加以下依赖项:
如果需要,您还可以包含特定的数据库驱动程序。