5 Things You May Not Have Known About jOOQ

jOOQ has been around for a while now (since 2009!) and by now we can say we've seen quite a bit of things about the SQL and Java languages. Some of our design decisions are particular in the way jOOQ thinks about programming with SQL. These include: Nullability (let's stop fighting it) Value types (let's … Continue reading 5 Things You May Not Have Known About jOOQ

jOOQ 3.10 Supports Exciting MySQL 8.0 Features

In recent months, there had been some really exciting news from the MySQL team: (Recursive) Common Table Expressions in MySQL Introducing Window Functions These two SQL standard language features are among the most powerful SQL features that are available from most other databases. I frequently include them in conference talks about SQL (see my article … Continue reading jOOQ 3.10 Supports Exciting MySQL 8.0 Features

A Curious Java Language Feature and How it Produced a Subtle Bug

Java's visibility rules are tricky at times. Do you know what this will print? package p; import static p.A.x; class A { static String x = "A.x"; } class B { String x = "B.x"; } class C { String x = "C.x"; class D extends B { void m() { System.out.println(x); } } } … Continue reading A Curious Java Language Feature and How it Produced a Subtle Bug

Don’t Overdo the “Principle of Least Astonishment” Cargo Cult

As we all agree, GOTO is evil, right? Relevant XKCD Or even funnier: New Intern Knows Best Of course, GOTO isn't evil Of course, somewhere deep down in our professional selves, we know that GOTO isn't evil, it's just a very basic processor instruction that was available since the early days of assembly code. GOTO … Continue reading Don’t Overdo the “Principle of Least Astonishment” Cargo Cult

Don’t Extract Everything Into a Method

Every now and then, I tweet something like this, just to piss off some clean coders: https://twitter.com/lukaseder/status/885498470542577673 Apart from the obvious trolling factor (why can't I ever resist?), I do think there's something thought provoking in such a tweet. First off, given how rare break and continue statements are in Java code, many people probably … Continue reading Don’t Extract Everything Into a Method

How I Incorrectly Fetched JDBC ResultSets. Again.

You know JDBC, right? It's that really easy, concise API that we love to use to work with virtually any database, relational or not. It has essentially three types that you need to care about: Connection Statement (and its subtypes) ResultSet All the other types some sort of utilities. Now, with the above three, we … Continue reading How I Incorrectly Fetched JDBC ResultSets. Again.

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!