Skip to content

Commit

Permalink
Add documentation for DB2 JDBC extension
Browse files Browse the repository at this point in the history
  • Loading branch information
aguibert committed Jun 29, 2020
1 parent 869c654 commit bb7f313
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
17 changes: 15 additions & 2 deletions docs/src/main/asciidoc/datasource.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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`
Expand Down Expand Up @@ -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`
Expand Down Expand Up @@ -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`
Expand Down Expand Up @@ -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://<serverName>[:<portNumber>]/<databaseName>[:<key1>=<value>;[<key2>=<value2>;]]`

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:]//<hostDescription>[,<hostDescription>...]/[database][?<key1>=<value1>[&<key2>=<value2>]]`
Expand Down
1 change: 1 addition & 0 deletions docs/src/main/asciidoc/hibernate-orm.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void registerDriver(BuildProducer<JdbcDriverBuildItem> jdbcDriver,
jdbcDriver.produce(new JdbcDriverBuildItem(DatabaseKind.DB2, "com.ibm.db2.jcc.DB2Driver",
"com.ibm.db2.jcc.DB2XADataSource"));
}

@BuildStep
void configureAgroalConnection(BuildProducer<AdditionalBeanBuildItem> additionalBeans,
Capabilities capabilities) {
Expand Down
2 changes: 1 addition & 1 deletion extensions/jdbc/jdbc-db2/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<artifactId>quarkus-jdbc-db2</artifactId>
<name>Quarkus - JDBC - DB2 - Runtime</name>
<description>DB2 database connector</description>
<description>Connect to the DB2 database via JDBC</description>

<dependencies>
<dependency>
Expand Down

0 comments on commit bb7f313

Please sign in to comment.