Files
turso/bindings/java
Pekka Enberg e929c252b4 Merge 'bindings/java: implement stream binding methods (int, InputStream, int) in JDBC4PreparedStatement' from Orange banana
## Purpose
* Implement `setAsciiStream(int, InputStream, int)`,
`setUnicodeStream(int, InputStream, int)`, and `setBinaryStream(int,
InputStream, int)` methods in JDBC4PreparedStatemen
## Changes
* `setAsciiStream(int, InputStream, int)`: Reads ASCII bytes, converts
to `String` using `US_ASCII` and binds with `bindText()`.
* `setUnicodeStream(int, InputStream, int)`: Reads bytes as `UTF-8`
encoded text and binds with `bindText()`.
* `setBinaryStream(int, InputStream, int)`: Reads raw bytes and binds
with `bindBlob()`.
* Added consistent error handling and validation
  * null stream - `bindNull()`
  * Negative length - throws `SQLException`
  * Empty stream  - Empty String or Empty Array
  * I/O errors - throw `SQLException`
* Ensures consistency between `setXxxStream` and `getXxxStream` methods,
so data written and read use the same encoding.
## Related Issue
* #615

Reviewed-by: Kim Seon Woo (@seonWKim)

Closes #3917
2025-11-10 11:07:08 +02:00
..
2025-10-08 15:43:27 +09:00
2025-09-11 12:17:05 +00:00
2025-07-13 11:43:26 -04:00
2025-07-13 11:43:26 -04:00
2025-11-06 08:33:13 +02:00
2025-01-05 10:28:05 +02:00
2025-01-05 10:28:05 +02:00
2025-10-07 23:33:13 +09:00
2025-07-03 10:56:05 -03:00
2025-07-03 10:56:05 -03:00

Turso JDBC Driver

The Turso JDBC driver is a library for accessing and creating Turso database files using Java.

Project Status

The project is actively developed. Feel free to open issues and contribute.

To view related works, visit this issue.

How to use

Currently, we have not published to the maven central. Instead, you can locally build the jar and deploy it to maven local to use it.

Build jar and publish to maven local

$ cd bindings/java

# Please select the appropriate target platform, currently supports `macos_x86`, `macos_arm64`, `windows` and `linux_x86`
$ make macos_x86

# deploy to maven local
$ make publish_local

Now you can use the dependency as follows:

dependencies {
    implementation("tech.turso:turso:0.0.1-SNAPSHOT")
}

Code style

  • Favor composition over inheritance. For example, JDBC4Connection doesn't implement TursoConnection. Instead, it includes TursoConnection as a field. This approach allows us to preserve the characteristics of Turso using TursoConnection easily while maintaining interoperability with the Java world using JDBC4Connection.