Skip to content

Holon Platform JDBC module. Provides Java DataBase Connectivity support, dealing with javax.sql.DataSource configuration and management in single or multiple persistence source enviroments.

License

Notifications You must be signed in to change notification settings

holon-platform/holon-jdbc

Repository files navigation

Holon platform JDBC module

Latest release: 5.7.0

This is the JDBC module of the Holon Platform, which provides Java DataBase Connectivity support, dealing with javax.sql.DataSource configuration and management in single or multiple persistence source enviroments.

The module main features are:

  • A DataSourceBuilder API to create and configure javax.sql.DataSource instances using a configuration property source and supporting the most popular and best performing pooling DataSource implementations (HikariCP, Apache DBCP2 and Tomcat JDBC Connection Pool).
  • A basic multi-tenant DataSource implementation using the platform foundation TenantResolver interface.
  • Spring integration for javax.sql.DataSource beans configuration and initialization (with Spring's transaction management support) using the @EnableDataSource configuration annotation.
  • Spring Boot integration for single or multiple javax.sql.DataSource beans auto-configuration using application.properties/application.yaml configuration properties.

See the module documentation for details.

Just like any other platform module, this artifact is part of the Holon Platform ecosystem, but can be also used as a stand-alone library.

See Getting started and the platform documentation for further details.

At-a-glance overview

JDBC DataSource configuration:

DataSourceConfigProperties config = DataSourceConfigProperties.builder()
	.withPropertySource("datasource.properties").build();

DataSource dataSource = DataSourceBuilder.create().build(config);

JDBC DataSource builder:

DataSource dataSource = DataSourceBuilder.builder() 
	.type(DataSourceType.HIKARICP)
	.url("jdbc:h2:mem:testdb")
	.username("sa") 
	.minPoolSize(5)
	.withInitScriptResource("init.sql")
	.build();

Spring Boot multiple DataSource auto-configuration:

holon: 
  datasource:
    one:
      url: "jdbc:h2:mem:testdb1"
      username: "sa"
    two:
      url: "jdbc:h2:mem:testdb2"
      username: "sa"

See the module documentation for the user guide and a full set of examples.

Code structure

See Holon Platform code structure and conventions to learn about the "real Java API" philosophy with which the project codebase is developed and organized.

Getting started

System requirements

The Holon Platform is built using Java 11, so you need a JRE/JDK version 11 or above to use the platform artifacts.

Releases

See releases for the available releases. Each release tag provides a link to the closed issues.

Obtain the artifacts

The Holon Platform is open source and licensed under the Apache 2.0 license. All the artifacts (including binaries, sources and javadocs) are available from the Maven Central repository.

The Maven group id for this module is com.holon-platform.jdbc and a BOM (Bill of Materials) is provided to obtain the module artifacts:

Maven BOM:

<dependencyManagement>
    <dependency>
        <groupId>com.holon-platform.jdbc</groupId>
        <artifactId>holon-jdbc-bom</artifactId>
        <version>5.7.0</version>
        <type>pom</type>
        <scope>import</scope>
    </dependency>
</dependencyManagement>

See the Artifacts list for a list of the available artifacts of this module.

Using the Platform BOM

The Holon Platform provides an overall Maven BOM (Bill of Materials) to easily obtain all the available platform artifacts:

Platform Maven BOM:

<dependencyManagement>
    <dependency>
        <groupId>com.holon-platform</groupId>
        <artifactId>bom</artifactId>
        <version>${platform-version}</version>
        <type>pom</type>
        <scope>import</scope>
    </dependency>
</dependencyManagement>

See the Artifacts list for a list of the available artifacts of this module.

Build from sources

You can build the sources using Maven (version 3.3.x or above is recommended) like this:

mvn clean install

Getting help

Examples

See the Holon Platform examples repository for a set of example projects.

Contribute

See Contributing to the Holon Platform.

Gitter chat Join the contribute Gitter room for any question and to contact us.

License

All the Holon Platform modules are Open Source software released under the Apache 2.0 license.

Artifacts list

Maven group id: com.holon-platform.jdbc

Artifact id Description
holon-jdbc Core artifact, providing DataSourceBuilder API and multi-tenancy support
holon-jdbc-spring Spring integration using the @EnableDataSource annotation
holon-jdbc-spring-boot Spring Boot integration for DataSource auto-configuration
holon-starter-jdbc Spring Boot starter for DataSource auto-configuration
holon-starter-jdbc-hikaricp Spring Boot starter for DataSource auto-configuration using the HikariCP pooling DataSource implementation
holon-jdbc-bom Bill Of Materials
documentation-jdbc Documentation

About

Holon Platform JDBC module. Provides Java DataBase Connectivity support, dealing with javax.sql.DataSource configuration and management in single or multiple persistence source enviroments.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages