Kotysa for Spring JDBC

Dependency

kotysa-spring-jdbc is a single dependency you can add to your Spring project.
This is a companion version for spring-jdbc 6.0.x (included in Spring boot 3.0.X) and does not replace it.

repositories {
    mavenCentral()
}

dependencies {
    implementation 'org.ufoss.kotysa:kotysa-spring-jdbc:3.2.1'
    
    implementation 'org.springframework:spring-jdbc'
}

Check this sample projectopen in new window for a Spring Boot Servlet WebMVC application with a JDBC backend accessed via kotysa-spring-jdbc

Usage

kotysa-spring-jdbc provides a SQL client on top of spring-jdbc, it can be obtained via an Extension function directly on spring-jdbc's JdbcOperations.

class Repository(client: JdbcOperations, tables: H2Tables) {

	private val sqlClient = client.sqlClient(tables)

	// enjoy sqlClient for spring-jdbc :)
}

Supported databases

Transaction

kotysa-spring-jdbc provides a transaction on top of spring-tx, it can be obtained via an Extension function directly on spring-tx's TransactionOperations.

class Service(template: TransactionOperations) {

	private val operator = template.transactionalOp()

	// use transaction
}
Last Updated:
Contributors: pull-vert