diff --git a/src/main/asciidoc/jdbc.adoc b/src/main/asciidoc/jdbc.adoc index f40a6eb0..490ce806 100644 --- a/src/main/asciidoc/jdbc.adoc +++ b/src/main/asciidoc/jdbc.adoc @@ -169,13 +169,20 @@ There are a couple of things one might want to customize in this setup. === Dialects Spring Data JDBC uses implementations of the interface `Dialect` to encapsulate behavior that is specific to a database or its JDBC driver. -By default the `AbstractJdbcConfiguration` tries to determine the database in use an register the correct `Dialect`. +By default, the `AbstractJdbcConfiguration` tries to determine the database in use an register the correct `Dialect`. This behavior can be changed by overwriting `jdbcDialect(NamedParameterJdbcOperations)`. -TIP: Dialects are resolved by [`JdbcDialectResolver`] from `JdbcOperations`, typically by inspecting `Connection`. +TIP: Dialects are resolved by `JdbcDialectResolver` from `JdbcOperations`, typically by inspecting `Connection`. You can let Spring auto-discover your `Dialect` by registering a class that implements `org.springframework.data.jdbc.repository.config.DialectResolver$JdbcDialectProvider` through `META-INF/spring.factories`. `DialectResolver` discovers dialect provider implementations from the class path using Spring's `SpringFactoriesLoader`. +If you use a database for which no dialect is available, then your application won’t startup. In that case, you’ll have to ask your vendor to provide a `Dialect` implementation. Alternatively, you can: + +1. Implement your own `Dialect`. +2. Implement a `JdbcDialectProvider` returning the `Dialect`. +3. Register the provider by creating a `spring.factories` resource under `META-INF` and perform the registration by adding a line + +`org.springframework.data.jdbc.repository.config.DialectResolver$JdbcDialectProvider=` + [[jdbc.entity-persistence]] == Persisting Entities diff --git a/src/main/asciidoc/preface.adoc b/src/main/asciidoc/preface.adoc index c40c20ac..bfa73e16 100644 --- a/src/main/asciidoc/preface.adoc +++ b/src/main/asciidoc/preface.adoc @@ -37,6 +37,19 @@ See the Spring framework https://spring.io/docs[home page] for more information. The Spring Data JDBC binaries require JDK level 8.0 and above and https://spring.io/docs[Spring Framework] {springVersion} and above. +In terms of databases, Spring Data JDBC requires a <> to abstract common SQL functionality over vendor-specific flavours. +Support for the following databases is bundled with Spring Data JDBC binaries: + +* DB2 +* H2 +* HSQLDB +* MariaDB +* Microsoft SQL Server +* MySQL +* Postgres + +If you use a different database then your application won’t startup. The <> section contains further detail on how to proceed in such case. + [[get-started:help]] == Additional Help Resources