|
2 | 2 |
|
3 | 3 | === Default database type |
4 | 4 |
|
5 | | -When the tests are executed without any special configuration, dev-service `H2` database is used (more details will follow). |
| 5 | +When the tests are executed without any special configuration, dev service `H2` database is used (more details will follow). |
6 | 6 |
|
7 | | -=== Dev-service databases |
| 7 | +=== Quarkus Dev Service databases |
8 | 8 |
|
9 | | -As is described in the https://quarkus.io/guides/datasource#dev-services[documentation], several database types could be started in dev-service mode. |
10 | | -Running the tests against a database in dev-service mode could be achieved by addition of build property `cq.sqlJdbcKind`. Example of usage: |
| 9 | +As described in the https://quarkus.io/guides/datasource#dev-services[documentation], several database types can be started in dev service mode. |
| 10 | +Running the tests against a database in dev service mode can be achieved by addition of build property `cq.sqlJdbcKind`. For example. |
11 | 11 |
|
12 | | -`mvn clean test -f integration-tests/sql/ -Dcq.sqlJdbcKind=postgresql` |
| 12 | +[source] |
| 13 | +---- |
| 14 | +mvn clean test -f integration-tests/sql/ -Dcq.sqlJdbcKind=postgresql |
| 15 | +---- |
13 | 16 |
|
14 | | -Following databases could be started in the dev-service mode: |
| 17 | +The following databases can be started in dev service mode: |
15 | 18 |
|
16 | 19 | - Postgresql (container) - add `-Dcq.sqlJdbcKind=postgresql` |
17 | 20 | - MySQL (container) - add `-Dcq.sqlJdbcKind=mysql` |
18 | 21 | - MariaDB (container) - add `-Dcq.sqlJdbcKind=mariadb` |
19 | 22 | - H2 (in-process) used by default |
20 | | -- Apache Derby (in-process) - add `-Dcq.sqlJdbcKind=derby` |
| 23 | +- Apache Derby (container) - add `-Dcq.sqlJdbcKind=derby` |
21 | 24 | - DB2 (container) (requires license acceptance) - add `-Dcq.sqlJdbcKind=db2` |
22 | 25 | - MSSQL (container) (requires license acceptance) - add `-Dcq.sqlJdbcKind=mssql` |
| 26 | +- Oracle (container) - add `-Dcq.sqlJdbcKind=oracle` |
23 | 27 |
|
24 | | -For more information about dev-service mode, see https://quarkus.io/guides/datasource#dev-services[documentation]. |
| 28 | +For more information about dev service mode, see https://quarkus.io/guides/datasource#dev-services[documentation]. |
25 | 29 |
|
26 | 30 | === External databases |
27 | 31 |
|
28 | | -To execute the tests against external database, configure database type by providing a build property in the same way as with dev-service mode (see previous chapter). |
29 | | -Provide the rest of database's connection information by setting environment variables |
| 32 | +To execute the tests against external database, configure database type by providing a build property in the same way as with dev service mode (see previous chapter). |
30 | 33 |
|
31 | | -``` |
32 | | -export SQL_JDBC_URL=#jdbc_url |
33 | | -export SQL_JDBC_USERNAME=#username |
34 | | -export SQL_JDBC_PASSWORD=#password |
35 | | -``` |
| 34 | +The database JDBC connection URL and username / password credentials can be provided via environment variables. |
36 | 35 |
|
37 | | -or for windows: |
| 36 | +[source] |
| 37 | +---- |
| 38 | +export QUARKUS_DATASOURCE_JDBC_URL=#jdbc_url |
| 39 | +export QUARKUS_DATASOURCE_USERNAME=#username |
| 40 | +export QUARKUS_DATASOURCE_PASSWORD=#password |
| 41 | +---- |
38 | 42 |
|
39 | | -``` |
40 | | -$Env:SQL_JDBC_URL = "#jdbc_url" |
41 | | -$Env:SQL_JDBC_USERNAME="#username" |
42 | | -$Env:SQL_JDBC_PASSWORD="#password" |
43 | | -``` |
| 43 | +or for windows: |
44 | 44 |
|
45 | | -Oracle database could be used as external db. In that case use parameter `-Dcq.sqlJdbcKind=oracle`. |
| 45 | +[source] |
| 46 | +---- |
| 47 | +$Env:QUARKUS_DATASOURCE_JDBC_URL="#jdbc_url" |
| 48 | +$Env:QUARKUS_DATASOURCE_USERNAME="#username" |
| 49 | +$Env:QUARKUS_DATASOURCE_PASSWORD="#password" |
| 50 | +---- |
46 | 51 |
|
47 | 52 | === External Derby database |
48 | 53 |
|
49 | | -To execute tests against external Derby database, stored procedure has to be uploaded into the database classpath. |
50 | | -Jar with stored procedure for the derby database is creaed by module `sql-derby`. |
51 | | -Jar could be uploaded via following commands through `ij`: |
52 | | -``` |
53 | | -CALL sqlj.install_jar('/PATH_TO_JAR/camel-quarkus-integration-test-sql-derby-stored-procedure-*.jar', 'AddNumsProcedure' , 0) |
54 | | - |
55 | | -CALL syscs_util.syscs_set_database_property('derby.database.classpath', 'APP.ADDNUMSPROCEDURE') |
56 | | -``` |
57 | | - |
58 | | -=== External Derby database via Docker |
59 | | - |
60 | | -To avoid manual upload of the jar, test can automatically use external derby database created via docker. |
61 | | -To execute the tests against external derby database, set the environment variable `SQL_USE_DERBY_DOCKER` to value `true`: |
62 | | - |
63 | | -``` |
64 | | -export SQL_USE_DERBY_DOCKER=true |
65 | | -``` |
66 | | - |
67 | | -or for windows: |
68 | | - |
69 | | -``` |
70 | | -$Env:SQL_USE_DERBY_DOCKER = "true" |
| 54 | +To avoid complexities around having to upload stored procedure JARs to the DB server, Apache Derby is always tested within a container. |
| 55 | +Therefore, you should avoid setting `QUARKUS_DATASOURCE` environment variables for Derby. |
0 commit comments