Skip to content

Commit 8ef047c

Browse files
mp911deschauder
authored andcommitted
DATAJDBC-555 - Document supported databases.
Original pull request: #225.
1 parent e560ca6 commit 8ef047c

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

src/main/asciidoc/jdbc.adoc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,20 @@ There are a couple of things one might want to customize in this setup.
169169
=== Dialects
170170

171171
Spring Data JDBC uses implementations of the interface `Dialect` to encapsulate behavior that is specific to a database or its JDBC driver.
172-
By default the `AbstractJdbcConfiguration` tries to determine the database in use an register the correct `Dialect`.
172+
By default, the `AbstractJdbcConfiguration` tries to determine the database in use an register the correct `Dialect`.
173173
This behavior can be changed by overwriting `jdbcDialect(NamedParameterJdbcOperations)`.
174174

175-
TIP: Dialects are resolved by [`JdbcDialectResolver`] from `JdbcOperations`, typically by inspecting `Connection`.
175+
TIP: Dialects are resolved by `JdbcDialectResolver` from `JdbcOperations`, typically by inspecting `Connection`.
176176
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`.
177177
`DialectResolver` discovers dialect provider implementations from the class path using Spring's `SpringFactoriesLoader`.
178178

179+
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:
180+
181+
1. Implement your own `Dialect`.
182+
2. Implement a `JdbcDialectProvider` returning the `Dialect`.
183+
3. Register the provider by creating a `spring.factories` resource under `META-INF` and perform the registration by adding a line +
184+
`org.springframework.data.jdbc.repository.config.DialectResolver$JdbcDialectProvider=<fully qualified name of your JdbcDialectProvider>`
185+
179186
[[jdbc.entity-persistence]]
180187
== Persisting Entities
181188

src/main/asciidoc/preface.adoc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,19 @@ See the Spring framework https://spring.io/docs[home page] for more information.
3737

3838
The Spring Data JDBC binaries require JDK level 8.0 and above and https://spring.io/docs[Spring Framework] {springVersion} and above.
3939

40+
In terms of databases, Spring Data JDBC requires a <<jdbc.dialects,dialect>> to abstract common SQL functionality over vendor-specific flavours.
41+
Support for the following databases is bundled with Spring Data JDBC binaries:
42+
43+
* DB2
44+
* H2
45+
* HSQLDB
46+
* MariaDB
47+
* Microsoft SQL Server
48+
* MySQL
49+
* Postgres
50+
51+
If you use a different database then your application won’t startup. The <<jdbc.dialects,dialect>> section contains further detail on how to proceed in such case.
52+
4053
[[get-started:help]]
4154
== Additional Help Resources
4255

0 commit comments

Comments
 (0)