You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ap...@apache.org on 2026/06/12 13:38:39 UTC
(camel-examples) branch main updated (52e24599 -> b031674e)
This is an automated email from the ASF dual-hosted git repository.
apupier pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel-examples.git
from 52e24599 Bump software.amazon.awssdk:cloudtrail from 2.46.6 to 2.46.7
new 760341c7 CAMEL-23481: replace retired Apache Derby with H2 in camel-example repository
new b031674e CAMEL-23481 - Update readme replacing derby by h2
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
aggregate-dist/pom.xml | 6 +++---
.../src/main/java/org/apache/camel/example/Application.java | 4 ++--
jdbc/README.adoc | 2 +-
jdbc/pom.xml | 12 ++++--------
jdbc/src/main/resources/META-INF/spring/camel-context.xml | 4 ++--
jdbc/src/main/resources/{create-derby.sql => create-h2.sql} | 4 ++--
6 files changed, 14 insertions(+), 18 deletions(-)
rename jdbc/src/main/resources/{create-derby.sql => create-h2.sql} (94%)
(camel-examples) 01/02: CAMEL-23481: replace retired Apache Derby with H2 in camel-example repository
Posted by ap...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
apupier pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-examples.git
commit 760341c79eb8a0ccc881ad3d53a5518622d12b18
Author: Torsten Mielke <tm...@ibm.com>
AuthorDate: Fri Jun 12 13:33:05 2026 +0200
CAMEL-23481: replace retired Apache Derby with H2 in camel-example
repository
Apache Derby is a retired Apache project.
This commit migrates the jdbc/ and aggregate-dist/ examples
to use H2 Database for long-term maintainability.
Changes:
- Replace Derby dependencies (derby, derbytools) with H2 in pom.xml
- Update Spring embedded database configuration from DERBY to H2
- Rename create-derby.sql to create-h2.sql in jdbc/ example
- Update identity column syntax from Derby's GENERATED ALWAYS AS IDENTITY
to H2's simpler AUTO_INCREMENT syntax
- All standard SQL (VARCHAR, TIMESTAMP, parameterized queries) works
identically with no code changes required
Unit tests for both demos pass.
Made with help from AI tools.
---
aggregate-dist/pom.xml | 6 +++---
.../src/main/java/org/apache/camel/example/Application.java | 4 ++--
jdbc/pom.xml | 12 ++++--------
jdbc/src/main/resources/META-INF/spring/camel-context.xml | 4 ++--
jdbc/src/main/resources/{create-derby.sql => create-h2.sql} | 4 ++--
5 files changed, 13 insertions(+), 17 deletions(-)
diff --git a/aggregate-dist/pom.xml b/aggregate-dist/pom.xml
index 8a5f56a6..750e3cd7 100644
--- a/aggregate-dist/pom.xml
+++ b/aggregate-dist/pom.xml
@@ -79,9 +79,9 @@
<artifactId>camel-sql</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derby</artifactId>
- <version>${derby-version}</version>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ <version>${h2-version}</version>
</dependency>
<!-- logging -->
diff --git a/aggregate-dist/src/main/java/org/apache/camel/example/Application.java b/aggregate-dist/src/main/java/org/apache/camel/example/Application.java
index d090bfef..47d8ad40 100644
--- a/aggregate-dist/src/main/java/org/apache/camel/example/Application.java
+++ b/aggregate-dist/src/main/java/org/apache/camel/example/Application.java
@@ -56,7 +56,7 @@ public final class Application {
private static final int END = 100;
private static final String CID_HEADER = "corrId";
- private static final String DB_URL = "jdbc:derby:target/testdb;create=true";
+ private static final String DB_URL = "jdbc:h2:file:./target/testdb";
private static final String DB_USER = "admin";
private static final String DB_PASS = "admin";
@@ -153,7 +153,7 @@ public final class Application {
+ "version bigint not null"
+ ")");
} catch (SQLException e) {
- if (!e.getMessage().contains("already exists")) {
+ if (!e.getMessage().toLowerCase().contains("already exist")) {
LOG.error("Database initialization failure", e);
}
}
diff --git a/jdbc/pom.xml b/jdbc/pom.xml
index c127de4a..41ff4a44 100644
--- a/jdbc/pom.xml
+++ b/jdbc/pom.xml
@@ -35,6 +35,7 @@
<properties>
<category>Database</category>
<title>JDBC</title>
+ <h2-version>2.2.224</h2-version>
</properties>
<dependencyManagement>
@@ -77,14 +78,9 @@
<!-- jdbc -->
<dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derbytools</artifactId>
- <version>${derby-version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derby</artifactId>
- <version>${derby-version}</version>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ <version>${h2-version}</version>
</dependency>
<!-- logging -->
diff --git a/jdbc/src/main/resources/META-INF/spring/camel-context.xml b/jdbc/src/main/resources/META-INF/spring/camel-context.xml
index 35a537b8..15c740cd 100644
--- a/jdbc/src/main/resources/META-INF/spring/camel-context.xml
+++ b/jdbc/src/main/resources/META-INF/spring/camel-context.xml
@@ -29,8 +29,8 @@
<!--
Embedded in-memory database setup.
-->
- <jdbc:embedded-database id="dataSource" type="DERBY">
- <jdbc:script location="classpath:create-derby.sql"/>
+ <jdbc:embedded-database id="dataSource" type="H2">
+ <jdbc:script location="classpath:create-h2.sql"/>
</jdbc:embedded-database>
<!--
diff --git a/jdbc/src/main/resources/create-derby.sql b/jdbc/src/main/resources/create-h2.sql
similarity index 94%
rename from jdbc/src/main/resources/create-derby.sql
rename to jdbc/src/main/resources/create-h2.sql
index 4f00aefc..930bf497 100644
--- a/jdbc/src/main/resources/create-derby.sql
+++ b/jdbc/src/main/resources/create-h2.sql
@@ -34,8 +34,8 @@
/*
STATUS : 'NEW', 'DONE'
*/
-CREATE TABLE CAMEL_TEST (
- ID BIGINT GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
+CREATE TABLE CAMEL_TEST (
+ ID BIGINT AUTO_INCREMENT,
MSG VARCHAR(10240),
STATUS CHAR(4) DEFAULT 'NEW',
CREATE_TS TIMESTAMP DEFAULT CURRENT_TIMESTAMP
(camel-examples) 02/02: CAMEL-23481 - Update readme replacing derby by h2
Posted by ap...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
apupier pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-examples.git
commit b031674e5f18824c1229f690e304fac275d17475
Author: Aurélien Pupier <ap...@ibm.com>
AuthorDate: Fri Jun 12 15:23:36 2026 +0200
CAMEL-23481 - Update readme replacing derby by h2
Signed-off-by: Aurélien Pupier <ap...@ibm.com>
---
jdbc/README.adoc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/jdbc/README.adoc b/jdbc/README.adoc
index 47a6dac8..7003eed0 100644
--- a/jdbc/README.adoc
+++ b/jdbc/README.adoc
@@ -3,7 +3,7 @@
=== Introduction
This example shows how to use camel-jdbc component with an embedded
-Apache Derby database.
+H2 database.
=== Build