Skip to content

build: support Java 17 and later - #62

Merged
omer-cengel merged 3 commits into
masterfrom
feature/java-17-baseline
Oct 9, 2026
Merged

omer-cengel merged 3 commits into
masterfrom
feature/java-17-baseline

Conversation

@omer-cengel

Copy link
Copy Markdown
Member

Summary

sqlcj, its runtime, and the code it generates now build and run on Java 17 or later instead of requiring Java 21, so projects still on the Java 17 LTS can adopt it. The generated code, the runtime API, and every diagnostic are unchanged.

Changes

  • Build every module with --release 17; runtime and CLI class files now target Java 17.
  • Replace the Java 21-only constructs with Java 17 equivalents that behave the same:
    • record patterns in JdbcQueryExecutor parameter binding become type patterns with record accessors;
    • List.getFirst()/getLast() become index access in main and test sources;
    • keyword checks use SourceVersion.RELEASE_17, which answers identically for the identifiers sqlcj checks;
    • a pattern-matching instanceof in the SQL parameter compiler becomes a null check with the same error message.
  • Set the external Maven sample and the quickstart's example POM to release 17.
  • State "Java 17 or later" in the README requirements, the quickstart prerequisites, and the release-verification script.
  • Run the test suite and the external-sample release verification in CI on both Java 17 and Java 21. The job name now includes the Java version, so required status checks that match the old job name need to be updated.

Scope and non-goals

  • No change to generated source text, parameter or selected-column order, runtime binding, schema or query behavior, or any diagnostic.
  • No dependency version changes, and no toolchains or enforcer configuration.
  • The formatting, CodeQL, and dependency-review workflows still run on their existing Java version.

@omer-cengel
omer-cengel merged commit bfd499f into master Oct 9, 2026
7 checks passed
@omer-cengel
omer-cengel deleted the feature/java-17-baseline branch October 9, 2026 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant