sql

Giu 2024-11-08T21:56:34.767659Z

Hi. Somebody knows a postgresql library working under Java 8? I tried pg2 but complains with: org/pg/enums/CopyFormat has been compiled by a more recent version of the Java Runtime (class file version 60.0) That means Java 16

igrishaev 2024-11-09T11:19:10.224769Z

Most likely you need next. Jdbc with postgres driver. Pg2 requires java 16

seancorfield 2024-11-10T00:55:16.650929Z

I have no idea whether next.jdbc will work with JDK 8. I haven't tested it against that version for ages and several of the drivers I test against are JDK 11+. The last version of next.jdbc that was tested against JDK 8 was 1.2.796 -- 2022-08-01 -- so I know that version will work, but later versions may work. JDK 8 is... very old... and you'll likely need to use older versions of a lot of libraries in order to get stuff to run on it. Is there a reason you need to support JDK 8?

p-himik 2024-11-08T21:57:55.121099Z

The official JDBC driver is compiled against Java 8.

p-himik 2024-11-08T21:58:30.017849Z

And you can use it in tandem with next.jdbc.

Giu 2024-11-08T21:59:27.379509Z

Will take a look at it tomorrow. Thanks a lot

Giu 2024-11-10T08:01:19.999539Z

@seancorfield I confirm you com.github.seancorfield/next.jdbc {:mvn/version "1.3.955"] works with java 8. Reason is related to https://clojurians.slack.com/archives/C053AK3F9/p1731085681331509 I did. Basically, while I get the time to put effort to a complete migration of a Java project I developed to Clojure, I want to implement new features with clojure and extend it as a learning exercise, and the framework used in this project doesn't works with newer Java versions. @jr0cket suggested to implement that new features as parallel project and use REST as communication, but I didn't considered at start because is another layer to learn (REST server implementation, another docker to maintain, another docker to deploy to azure) compared to just include the jar and call the functions, but probably is the best way to go,

seancorfield 2024-11-10T15:01:07.943549Z

Good to know the latest version still works with JDK 8. Just bear in mind I don't test that, so it could easily break in a future version. Officially, JDK 11 is the oldest I support. Rewriting legacy code from the bottom up was part of how we moved from JDK 8 to JDK 21 too.