3.15.0 Release with Support for R2DBC, Nested ROW, ARRAY, and MULTISET types, 5 new SQL dialects, CREATE PROCEDURE, FUNCTION, and TRIGGER support and Much More

R2DBC What a lot of users have been waiting for: jOOQ 3.15 is reactive, thanks to the new native R2DBC integration. Recent versions already implemented the reactive streams Publisher SPI, but now we're not cheating anymore. We're not longer blocking. Just wrap your R2DBC ConnectionFactory configured jOOQ query in a Flux (or any reactive streams … Continue reading 3.15.0 Release with Support for R2DBC, Nested ROW, ARRAY, and MULTISET types, 5 new SQL dialects, CREATE PROCEDURE, FUNCTION, and TRIGGER support and Much More

Imperative Loop or Functional Stream Pipeline? Beware of the Performance Impact!

I like weird, yet concise language constructs and API usages https://twitter.com/nipafx/status/1055451667079008256 Yes. I am guilty. Evil? Don't know. But guilty. I heavily use and abuse the java.lang.Boolean type to implement three valued logic in Java: Boolean.TRUE means true (duh) Boolean.FALSE means false null can mean anything like "unknown" or "uninitialised", etc. I know - a … Continue reading Imperative Loop or Functional Stream Pipeline? Beware of the Performance Impact!

Writing Custom Aggregate Functions in SQL Just Like a Java 8 Stream Collector

All SQL databases support the standard aggregate functions COUNT(), SUM(), AVG(), MIN(), MAX(). Some databases support other aggregate functions, like: EVERY() STDDEV_POP() STDDEV_SAMP() VAR_POP() VAR_SAMP() ARRAY_AGG() STRING_AGG() But what if you want to roll your own? Java 8 Stream Collector When using Java 8 streams, we can easily roll our own aggregate function (i.e. a … Continue reading Writing Custom Aggregate Functions in SQL Just Like a Java 8 Stream Collector

How to Compile a Class at Runtime with Java 8 and 9

In some cases, it's really useful to be able to compile a class at runtime using the java.compiler module. You can e.g. load a Java source file from the database, compile it on the fly, and execute its code as if it were part of your application. In the upcoming jOOR 0.9.8, this will be … Continue reading How to Compile a Class at Runtime with Java 8 and 9

How to Ensure Your Code Works With Older JDKs

jOOQ is a very backwards compatible product. This doesn't only mean that we keep our own API backwards compatible as well as possible, but we also still support Java 6 in our commercial distributions. In a previous blog post, I've shown how we manage to support Java 6 while at the same time not missing … Continue reading How to Ensure Your Code Works With Older JDKs

Squeezing Another 10% Speed Increase out of jOOQ using JMC and JMH

In this post, we're going to discuss a couple of recent efforts to squeeze roughly 10% in terms of speed out of jOOQ by iterating on hotspots that were detected using JMC (Java Mission Control) and then validated using JMH (Java Microbenchmark Harness). This post shows how to apply micro optimisations to algorithms where the … Continue reading Squeezing Another 10% Speed Increase out of jOOQ using JMC and JMH

jOOQ Tuesdays: Nicolai Parlog Talks About Java 9

Welcome to the jOOQ Tuesdays series. In this series, we’ll publish an article on the third Tuesday every other month where we interview someone we find exciting in our industry from a jOOQ perspective. This includes people who work with SQL, Java, Open Source, and a variety of other related topics. I'm very excited to … Continue reading jOOQ Tuesdays: Nicolai Parlog Talks About Java 9

Are Java 8 Streams Truly Lazy? Not Completely!

Notice, this issue has been fixed in Java 8 (8u222), thanks for the comment Zheka Kozlov In a recent article, I've shown that programmers should always apply a filter first, map later strategy with streams. The example I made there was this one: hugeCollection .stream() .limit(2) .map(e -> superExpensiveMapping(e)) .collect(Collectors.toList()); In this case, the limit() … Continue reading Are Java 8 Streams Truly Lazy? Not Completely!

A Nice API Design Gem: Strategy Pattern With Lambdas

With Java 8 lambdas being available to us as a programming tool, there is a "new" and elegant way of constructing objects. I put "new" in quotes, because it's not new. It used to be called the strategy pattern, but as I've written on this blog before, many GoF patterns will no longer be implemented … Continue reading A Nice API Design Gem: Strategy Pattern With Lambdas