Spring Cloud Data Flow provides schemas for H2, HSQLDB, MySQL, Oracle, PostgreSQL, DB2 and SQL Server that will be automatically created when the server starts.
The JDBC drivers for MySQL (via MariaDB driver), HSQLDB, PostgreSQL along with embedded H2 are available out of the box. If you are using any other database, then the corresponding JDBC driver jar needs to be on the classpath of the server.
For instance, If you are using MySQL in addition to password in the Secrets file provide the following properties in the ConfigMap:
data: application.yaml: |- spring: datasource: url: jdbc:mysql://${MYSQL_SERVICE_HOST}:${MYSQL_SERVICE_PORT}/mysql username: root password: ${mysql-root-password} driverClassName: org.mariadb.jdbc.Driver url: jdbc:mysql://${MYSQL_SERVICE_HOST}:${MYSQL_SERVICE_PORT}/test driverClassName: org.mariadb.jdbc.Driver
For PostgreSQL:
data: application.yaml: |- spring: datasource: url: jdbc:postgresql://${PGSQL_SERVICE_HOST}:${PGSQL_SERVICE_PORT}/database username: root password: ${postgres-password} driverClassName: org.postgresql.Driver
For HSQLDB:
data: application.yaml: |- spring: datasource: url: jdbc:hsqldb:hsql://${HSQLDB_SERVICE_HOST}:${HSQLDB_SERVICE_PORT}/database username: sa driverClassName: org.hsqldb.jdbc.JDBCDriver
![]() | Note |
---|---|
There is a schema update to the Spring Cloud Data Flow datastore when upgrading from version |