From bb7f313131b9eb0de12c5cd4d01f0380681546c8 Mon Sep 17 00:00:00 2001 From: Andrew Guibert Date: Mon, 29 Jun 2020 16:29:02 -0500 Subject: [PATCH] Add documentation for DB2 JDBC extension --- docs/src/main/asciidoc/datasource.adoc | 17 +++++++++++++++-- docs/src/main/asciidoc/hibernate-orm.adoc | 1 + .../jdbc/db2/deployment/JDBCDB2Processor.java | 2 +- extensions/jdbc/jdbc-db2/runtime/pom.xml | 2 +- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/docs/src/main/asciidoc/datasource.adoc b/docs/src/main/asciidoc/datasource.adoc index 578c480759777..51c536ec7934b 100644 --- a/docs/src/main/asciidoc/datasource.adoc +++ b/docs/src/main/asciidoc/datasource.adoc @@ -42,7 +42,7 @@ If you want a better understanding of how all this works, this guide has a lot m === JDBC datasource -Add the `agroal` extension plus one of `jdbc-derby`, `jdbc-h2`, `jdbc-mariadb`, `jdbc-mssql`, `jdbc-mysql` or `jdbc-postgresql`. +Add the `agroal` extension plus one of `jdbc-db2`, `jdbc-derby`, `jdbc-h2`, `jdbc-mariadb`, `jdbc-mssql`, `jdbc-mysql`, or `jdbc-postgresql`. Then configure your datasource: @@ -89,7 +89,7 @@ The database kind defines which type of database you will connect to. We currently include these built-in database kinds: -* DB2: `db2` (reactive only) +* DB2: `db2` * Derby: `derby` * H2: `h2` * MariaDB: `mariadb` @@ -151,6 +151,7 @@ You will also need to choose, and add, the Quarkus extension for your relational Quarkus provides driver extensions for: +* DB2 - `jdbc-db2` * Derby - `jdbc-derby` * H2 - `jdbc-h2` * MariaDB - `jdbc-mariadb` @@ -203,6 +204,10 @@ When using one of the built-in datasource kinds, the JDBC driver is resolved aut |=== |Database kind |JDBC driver |XA driver +|`db2` +|`com.ibm.db2.jcc.DBDriver` +|`com.ibm.db2.jcc.DB2XADataSource` + |`derby` |`org.apache.derby.jdbc.ClientDriver` |`org.apache.derby.jdbc.ClientXADataSource` @@ -524,6 +529,14 @@ Defaults for the different parts are as follows: The https://jdbc.postgresql.org/documentation/head/connect.html[official documentation] go into more detail and list optional parameters as well. +=== DB2 + +`jdbc:db2://[:]/[:=;[=;]]` + +Example:: `jdbc:db2://localhost:50000/MYDB:user=dbadm;password=dbadm;` + +See the https://www.ibm.com/support/knowledgecenter/SSEPGG_11.5.0/com.ibm.db2.luw.apdv.java.doc/src/tpc/imjcc_r0052342.html[official documentation] for more detail on URL syntax and additional supported options. + === MariaDB `jdbc:mariadb:[replication:|failover:|sequential:|aurora:]//[,...]/[database][?=[&=]]` diff --git a/docs/src/main/asciidoc/hibernate-orm.adoc b/docs/src/main/asciidoc/hibernate-orm.adoc index 8f006f109a8f5..a21f9961170cc 100644 --- a/docs/src/main/asciidoc/hibernate-orm.adoc +++ b/docs/src/main/asciidoc/hibernate-orm.adoc @@ -29,6 +29,7 @@ Add the following dependencies to your project: * the Hibernate ORM extension: `io.quarkus:quarkus-hibernate-orm` * your JDBC driver extension; the following options are available: + - `quarkus-jdbc-db2` for link:https://www.ibm.com/products/db2-database[IBM DB2] - `quarkus-jdbc-derby` for link:https://db.apache.org/derby/[Apache Derby] - `quarkus-jdbc-h2` for link:https://www.h2database.com/html/main.html[H2] - `quarkus-jdbc-mariadb` for link:https://mariadb.com/[MariaDB] diff --git a/extensions/jdbc/jdbc-db2/deployment/src/main/java/io/quarkus/jdbc/db2/deployment/JDBCDB2Processor.java b/extensions/jdbc/jdbc-db2/deployment/src/main/java/io/quarkus/jdbc/db2/deployment/JDBCDB2Processor.java index 709a4ac6292fc..6d75ad8c51242 100644 --- a/extensions/jdbc/jdbc-db2/deployment/src/main/java/io/quarkus/jdbc/db2/deployment/JDBCDB2Processor.java +++ b/extensions/jdbc/jdbc-db2/deployment/src/main/java/io/quarkus/jdbc/db2/deployment/JDBCDB2Processor.java @@ -28,7 +28,7 @@ void registerDriver(BuildProducer jdbcDriver, jdbcDriver.produce(new JdbcDriverBuildItem(DatabaseKind.DB2, "com.ibm.db2.jcc.DB2Driver", "com.ibm.db2.jcc.DB2XADataSource")); } - + @BuildStep void configureAgroalConnection(BuildProducer additionalBeans, Capabilities capabilities) { diff --git a/extensions/jdbc/jdbc-db2/runtime/pom.xml b/extensions/jdbc/jdbc-db2/runtime/pom.xml index baffa98c134f9..c3f92096be0df 100644 --- a/extensions/jdbc/jdbc-db2/runtime/pom.xml +++ b/extensions/jdbc/jdbc-db2/runtime/pom.xml @@ -11,7 +11,7 @@ quarkus-jdbc-db2 Quarkus - JDBC - DB2 - Runtime - DB2 database connector + Connect to the DB2 database via JDBC