~/devreads

#java

252 posts

27 May

Alyona Chernyaeva 2 min read

Last week at the KotlinConf 2026 keynote (watch the recording here), we announced Koog 1.0. Koog is JetBrains’ open-source framework for building AI agents in Kotlin and Java. It provides the core building blocks for agentic applications: tools, workflows, persistence, memory, observability, and integrations with existing JVM and Kotlin Multiplatform projects. We introduced Koog at […]

aijavakotlin

8 May

Netflix Technology Blog 10 min read

By John Burns and Emily Yuan Introduction At Netflix, we operate using a polyrepo strategy with tens of thousands of Java repositories. This means that we need to have ways of sharing common build logic across these repositories. On the JVM Ecosystem team within Java Platform, we build tooling such as the Nebula suite of Gradle plugins to provide standard…

gradlenebulajavaarchunit

15 Oct 2025

vladmihalcea 1 min read

Introduction My friend, Laurentiu Spilca, has been working on the second edition of his Troubleshooting Java book, and when I was asked to review it, I was more than happy to do it since the book features a lot of topics that I’m also very interested in, such as performance tuning and query optimization. Audience This book is useful for…

bookbook reviewjavatroubleshooting

11 Aug 2025

lukaseder 1 min read

When implementing the awesome MULTISET operator in jOOQ, its implementation mostly relied on SQL/JSON support of various RDBMS. In short, while standard SQL supports nested collections via ARRAY or MULTISET operators like this: This is poorly supported in most RDBMS, so jOOQ emulates it using SQL/JSON as follows (or similar): Wait a second. A JSON … Continue reading Consider using…

javacompressionjsonjson arrayjson object

11 Apr 2025

vladmihalcea 1 min read

Introduction In this article, I’m going to review the Foundations of AI and Machine Learning for Java Developers video course from my fellow Java Champion, Frank Greco. If you are new to AI and ML and want to get a great introduction to these topics, then you should definitely join watch the video lessons created by Frank Greco. And, thanks…

aicoursejavamlreview

8 Feb 2025

12 Dec 2024

vladmihalcea 1 min read

Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system using Java. Articles The pick of this week is this series of articles from Franck Pachot about Amazon Aurora Limitless, a PostgreSQL-compatible database that provides…

newsletterhibernatejavajpamysql

1 Nov 2024

vladmihalcea 1 min read

Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system using Java. Articles The pick of this week is this article about data alignment in PostgreSQL tables and indexes. By properly designing your tables and…

newsletterhibernatejavajpamysql

7 Oct 2024

vladmihalcea 1 min read

Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system using Java. Articles The pick of this week is this article about B+Tree indexes, which features a live tool that we can use to see…

newsletterhibernatejavajpamysql

2 Sept 2024

vladmihalcea 1 min read

Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system using Java. Articles The pick of this week is this article about the difference between the ON CONFLICT clause and the MERGE statement when using…

newsletterhibernatejavajpamysql

6 Aug 2024

vladmihalcea 1 min read

Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system using Java. Articles The pick of this week is this article about various online schema migration options that are available in MySQL. Another great read…

newsletterhibernatejavajpamysql

2 Jul 2024

vladmihalcea 1 min read

Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system using Java. Articles The pick of this week is this article about the drawbacks of using natural keys. Speaking of mapping tables, if you need…

newsletterhibernatejavajpapostgresql

4 Jun 2024

vladmihalcea 1 min read

Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system using Java. Articles The pick of this week is this article from Gergely Orosz about designing and scaling Bluesky. You will learn about favoring flexibility,…

newsletterhibernatejavajpapostgresql

14 May 2024

2 May 2024

vladmihalcea 1 min read

Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system using Java. Articles The pick of this week is this article which describes how bandwidth, latency, IOPS, and jitter works in a relational database system.…

newsletterhibernatejavajpamysql

3 Apr 2024

vladmihalcea 1 min read

Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system using Java. Articles The pick of this week is this article about Jakarta Persistence 3.2, which brings a lot of improvements to the JPA specifications,…

newsletterhibernatejavajpapostgresql

4 Mar 2024

vladmihalcea 1 min read

Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system using Java. Articles The pick of this week is this article about using the BUFFERS option in the PostgreSQL EXPLAIN ANALYZE so that we can…

newsletterhibernatejavajpamysql

24 Feb 2024

vladmihalcea 1 min read

Introduction In this article, we are going to see how we can use Java Records with Spring Data JPA Repositories. As I already explained, Java Records cannot be used as JPA entities since the Records are immutable, and JPA requires the entity class to have a default constructor and be modifiable, as that’s how the entity properties are populated when…

hibernatespringjavajparecords

1 Feb 2024

vladmihalcea 1 min read

Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system using Java. Articles The pick of this week is this article written by Lukas Eder about various query optimizations the database can do to speed…

newsletterhibernatejavajpamysql

18 Jan 2024

vladmihalcea 1 min read

Introduction In this article, we are going to see how to use the Java CountDownLatch to write test cases that take concurrency into consideration. The Java CountDownLatch has been available since version 1.5, and it’s part of the java.util.concurrent package that contains many other threading-related utilities. The Java CountDownLatch class The Java CountDownLatch class provides the following methods: The most…

javaconcurrencycountdownlatchthreads

10 Jan 2024

lukaseder 1 min read

One of jOOQ’s key features so far has always been to render pretty much exactly the SQL that users expect, without any surprises – unless some emulation is required to make a query work, of course. This means that while join elimination is a powerful feature of many RDBMS, it isn’t part of jOOQ’s feature … Continue reading A Hidden…

jooq-in-useimplicit joinsimplicit path joinjavajoin elimination

3 Jan 2024

vladmihalcea 1 min read

Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system using Java. Articles The pick of this edition is this series of articles about transaction isolation levels in PostgreSQL. Speaking of database transactions, this article…

newsletterhibernatejavajpamysql

13 Dec 2023

lukaseder 1 min read

Do you need to add a JDBC driver to your application, and don’t know its Maven coordinates? This blog post lists the most popular drivers from the jOOQ integration tests. Look up the latest versions directly on https://central.sonatype.com/ with parameters g:groupId a:artifactId, for example, the H2 database and driver: https://central.sonatype.com/search?q=g%3Acom.h2database+a%3Ah2 The list only includes drivers … Continue reading Maven Coordinates…

javasqljdbcjdbc driversmaven central

1 Dec 2023

vladmihalcea 1 min read

Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system using Java. Articles The pick of this edition is this article about PostgreSQL double buffering. Hibernate 6.3 added support for table partitioning, and in this…

newsletterhibernatejavajpapostgresql

1 Nov 2023

vladmihalcea 1 min read

Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system using Java. Articles The pick of this edition is this article about MySQL 8.2 automatic read and write routing. Until MySQL 8.2 is released, if…

newsletterhibernatejavajpapostgresql

3 Oct 2023

vladmihalcea 1 min read

Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system using Java. Articles The pick of this edition is this article that marks the 10-year anniversary of this blog. For over a decade, I managed…

newsletterhibernatejavajpapostgresql

5 Sept 2023

vladmihalcea 1 min read

Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system using Java. Articles The pick of this edition is this article, which explains how you can use the Hibernate Statistics in order to assert the…

newsletterhibernatejavajpamysql

7 Aug 2023

vladmihalcea 1 min read

Introduction In this article, we are going to see how the SQL Server useBulkCopyForBatchInsert configuration property works when using JDBC, JPA, or Hibernate. SQL Server PreparedStatement batching When using JPA and Hibernate, the generated SQL statements are going to be executed using the JDBC PreparedStatement because prepared statements increase the likelihood of statement caching, and you to avoid SQL injection…

javasql server

2 Aug 2023

vladmihalcea 1 min read

Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system using Java. Articles The pick of this edition is this article, which explains how the standard PostgreSQL MVCC system works and how the OrioleDB engine…

newsletterhibernatejavajpamysql

26 Jul 2023

vladmihalcea 1 min read

Introduction In this article, we are going to see how we can do JDBC profiling using the VisualVM tool to find slow-running SQL queries or discover N+1 query issues. VisualVM VisualVM is an OSS tool that allows us to inspect the JVM and the Java applications running inside the Java Virtual Machine. You can download VisualVM from this link and…

javahigh performancejdbcn+1performance tuning

4 Jul 2023

vladmihalcea 1 min read

Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system using Java. Articles The pick of this edition is this article, which provides a very thorough explanation of how queries are executed and how you…

newsletterhibernatejavajpamysql

31 May 2023

vladmihalcea 1 min read

Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system using Java. Articles The pick of this edition is this article which explains why performance engineering is not just about solving a few bottlenecks that…

newsletterhibernatejavajpamysql

3 May 2023

vladmihalcea 1 min read

Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system using Java. Articles The pick of this edition is this article, which explains the bad parts of PostgreSQL. While PostgreSQL is a great open-source database…

newsletterhibernatejavajpamysql

25 Apr 2023

lukaseder 1 min read

Microsoft T-SQL supports a language feature called table-valued parameter (TVP), which is a parameter of a table type that can be passed to a stored procedure or function. For example, you may write: This function takes a table-valued parameter (TVP), and produces a result set containing the cross product of the parameter table with itself. … Continue reading How to…

jooq-in-usecode generationcode generatorjavajdbc

19 Apr 2023

vladmihalcea 1 min read

Introduction In this article, we are going to see what is the best way to call SQL Server stored procedures with jOOQ. I decided to write this article because stored procedures and database functions are extremely useful for data-intensive applications, and sometimes, they are the only solution to process data efficiently. While SQL remains the de-facto way to query data,…

jooqjavasql serverstored procedure

4 Apr 2023

vladmihalcea 1 min read

Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system using Java. Articles The pick of this edition is this article, which explains the performance optimizations done by the Quora engineering team to scale their…

newsletterhibernatejavajpamysql

24 Mar 2023

1 Mar 2023

vladmihalcea 1 min read

Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system using Java. Articles The pick of this edition is this article that explains why an SQL Server query executed by an application can have a…

newsletterhibernatejavajpamysql

1 Feb 2023

vladmihalcea 1 min read

Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system using Java. Articles The pick of this edition is this article that not only explains how B+Tree indexes work in PostgreSQL, but it provides an…

newsletterhibernatejavajpamysql

5 Jan 2023

vladmihalcea 1 min read

Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system using Java. Articles The pick of this edition is this article about 10 common PostgreSQL mistakes and how you can avoid them. If you want…

newsletterhibernatejavajpamysql

30 Jun 2022

lukaseder 1 min read

One of jOOQ 3.17‘s coolest new features are client side computed columns. jOOQ 3.16 already added support for server side computed columns, which many of you appreciate for various reasons. What’s a computed column? A computed column is a column that is derived (“computed”) from an expression. It cannot be written to. It works like … Continue reading Create Dynamic…

jooq-developmentclient side computed columnscomputed columnsjavajooq

9 Jun 2022

lukaseder 1 min read

It’s been a while since jOOQ 3.15 has been released with its revolutionary standard SQL MULTISET emulation feature. A thing that has been long overdue and which I promised on twitter a few times is to run a few benchmarks comparing the performance of various approaches to nesting to-many relationships with jOOQ. This article will … Continue reading The Performance…

jooq-developmentjavajooqjson arrayaggmany-to-many

19 May 2022

lukaseder 1 min read

The jOOQ API is all about convenience, and as such, an important operation (the most important one?) like fetch() must come with convenience, too. The default way to fetch data is this: It fetches the entire result set into memory and closes the underlying JDBC resources eagerly. But what other options do we have? Iterable … Continue reading The Many…

joojooq-in-usecollectorconveniencejava

28 Apr 2022

lukaseder 1 min read

Since jOOQ 3.4, we have an API that simplifies transactional logic on top of JDBC in jOOQ, and starting from jOOQ 3.17 and #13502, an equivalent API will also be made available on top of R2DBC, for reactive applications. As with everything jOOQ, transactions are implemented using explicit, API based logic. The implicit logic implemented … Continue reading Nested Transactions…

jooq-developmentjakarta eejavajdbcjooq

1 Nov 2021

lukaseder 1 min read

This fun fact has been on my mind for a while, and a recent reddit thread about “Smuggling Checked Exceptions with Sealed Interfaces” made me write this post here. Namely, Java had union types before it was cool! (If you squint hard). What are union types? Ceylon is an underrated JVM language that never really … Continue reading Java’s Checked…

javaadtsalgebraic data typesceylonexhaustiveness checking

22 Oct 2021

lukaseder 1 min read

Java 16 includes an improvement that makes the language a bit more regular via JEP 395. The JEP says: Static members of inner classes It is currently specified to be a compile-time error if an inner class declares a member that is explicitly or implicitly static, unless the member is a constant variable. This means … Continue reading Write C-Style…

javajava 16jep 395static local variable

26 Aug 2021

lukaseder 1 min read

If your legacy JPA application is using occasional native queries or Hibernate @Formula or Spring Data @Query annotation with vendor specific native SQL embedded in it, you can use jOOQ’s parsing connection and parsing data source to translate between dialects, without having to go all in on your jOOQ adoption – though I think it’s … Continue reading Using jOOQ…

jooq-in-useeclipselinkhibernatejavajooq

6 Jul 2021

lukaseder 1 min read

This is how SQL should have been used all along. They called it The Third Manifesto, ORDBMS, or other things. Regrettably, it never really took off. Because most vendors didn’t adopt it. And those who did, didn’t agree on syntax. But this is about to change. Thanks to the now ubiquitous SQL/JSON support (which jOOQ … Continue reading jOOQ 3.15’s…

jooq-developmentdb2javajooqjson

17 May 2021

lukaseder 1 min read

In our opinion, any Iterable<T> should offer a <R> collect(Collector<T, ?, R>) method to allow for transforming the the content to something else using standard JDK collectors, jOOλ collectors from org.jooq.lambda.Agg or your own. When using jOOQ, you don’t have to wait for the JDK to finally add these useful utilities to the Iterable API. … Continue reading Use ResultQuery.collect()…

jooq-in-usecollectorcollectorsgroupingjava

22 Jul 2020

lukaseder 1 min read

I just fixed a bug. The fix required me to initialise an Object[] array with the init values for each type, instead of just null, i.e. false for boolean, 0 for int, 0.0 for double, etc. So, instead of just doing: I needed: For the subjective 8E17th time, I wrote a loop. A loop that … Continue reading Could we…

javaaplarrayloopset

30 Sept 2019

lukaseder 1 min read

One of the Stream APIs greatest features is its laziness. The whole pipeline is constructed lazily, stored as a set of instructions, akin to a SQL execution plan. Only when we invoke a terminal operation, the pipeline is started. It is still lazy, meaning that some operations may be short circuited. Some third party libraries … Continue reading A Quick…

javajava 8lazystream

6 Jun 2019

lukaseder 1 min read

How to write a simple API is already an art on its own. I didn’t have time to write a short letter, so I wrote a long one instead. ― Mark Twain But keeping an API simple for beginners and most users, and making it extensible for power users seems even more of a challenge. … Continue reading How to…

javaapiapi designdependency injectionextensibility

7 Dec 2018

lukaseder 1 min read

Annotation processors can be useful as a hacky workaround to get some language feature into the Java language. jOOQ also has an annotation processor that helps validate SQL syntax for: Plain SQL usage (SQL injection risk) SQL dialect support (prevent using an Oracle only feature on MySQL) You can read about it more in detail … Continue reading How to…

javaannotation processingannotation processorjooqjoor

22 Nov 2018

29 Oct 2018

lukaseder 1 min read

I like weird, yet concise language constructs and API usages 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: I know – a lot of enterprise developers will bikeshed and cargo cult the old saying: Code is read more often … Continue reading Imperative Loop…

javajava 8benchmarkfunctional programmingimperative programming

21 Sept 2018

lukaseder 1 min read

Everyone knows the SQL SUM() aggregate function (and many people also know its window function variant). When querying the Sakila database, we can get the daily revenue (using PostgreSQL syntax): The result will look something like this: date |daily_revenue |cumulative_revenue -----------|--------------|------------------- 2005-05-24 |29.92 |29.92 2005-05-25 |573.63 |603.55 2005-05-26 |754.26 |1357.81 2005-05-27 |685.33 |2043.14 2005-05-28 |804.04 … Continue reading How to…

sqlaggregate functionjavamultiplicationwindow function

28 Aug 2018

Schakko 1 min read

Just a quick reminder how to run a Spring Boot JAR (or any other self JAR executable) with SELinux enabled: chcon --type=java_exec_t /opt/myapp/spring-boot-app.jar To make this persistent you have to use the bin_exec_t type as java_exec_t is just an alias: # apply the bin_exec_t semanage fcontext -a -t bin_exec_t /opt/myapp/spring-boot-app.jar […] The post Running a Spring Boot JAR service with…

javalinux

15 Jun 2018

lukaseder 1 min read

Clock’s ticking. JDK 11 will remove a bunch of deprecated modules through JEP 320, which includes the Java EE modules, which again includes JAXB, a dependency of many libraries, including jOOQ. Thus far, few people have upgraded to Java 9 or 10, as these aren’t LTS releases. Unlike in the old days, however, people will … Continue reading How to…

javajava 10debugidejigsaw

6 Jun 2018

lukaseder 1 min read

In this much overdue article, I will explain why I think that in almost all cases, you should implement a “database first” design in your application’s data models, rather than a “Java first” design (or whatever your client language is), the latter approach leading to a long road of pain and suffering, once your project … Continue reading Truth First,…

javajooq-developmentmigrationscode generationdatabase first

17 May 2018

1 min read

Last week, I was fortunate enough to attend GeeCON. GeeCON is a well-known conference in the JVM world and this year marked its 10th anniversary. More than 1200 people came to see over 80 sessions from more than 70 speakers distributed across 4 tracks over 3 days in Krakow, Poland. This was my first time attending GeeCON. In retrospect,...

java 9javageecontalkspeaking

2 May 2018

lukaseder 1 min read

When inserting records into SQL databases, we often want to fetch back generated IDs and possibly other trigger, sequence, or default generated values. Let’s assume we have the following table: DB2 DB2 is the only database currently supported by jOOQ, which implements the SQL standard according to which we can SELECT from any INSERT statement, … Continue reading How to…

javasqlarray typesbatch insertbatch insertion

25 Apr 2018

1 min read

Java With The Best is a new Java conference in a series of developer conferences powered by BeMyApp. There are 2 main properties that differentiate this event from other conferences you may have attended – everything takes place online, without a physical venue, and attendees can book virtual 1-1 sessions with the speakers. The event featured 58...

javajava 9java with the besttalkspeaking

10 Apr 2018

lukaseder 1 min read

In a previous blog post, I’ve shown how the programmatic MockDataProvider can be used to mock the entire JDBC API through a single functional interface: Writing the provider manually can be tedious in some cases, especially when a few static SQL strings need to be mocked and constant result sets would be OK. In that … Continue reading Mocking JDBC…

javajooq-in-usedatabase mockingjdbc mockingjooq

1 Apr 2018

28 Mar 2018

lukaseder 1 min read

When performing reflective access to default methods in Java, Google seems to fail us. The solutions presented on Stack Overflow, for instance, seem to work only in a certain set of cases, and not on all Java versions. This article will illustrate different approaches to calling interface default methods through reflection, as may be required … Continue reading Correct Reflective…

javajava 10java 8java 9default methods

13 Mar 2018

lukaseder 1 min read

The SQL standard is a nice thing. But it’s a standard. And as such, while it may provide good guidelines on how to implement some SQL features, most dialects deviate from it in one way or another (sometimes drastically, cheers, MySQL). But that doesn’t have to be a bad thing. Innovation is not driven by … Continue reading Top 10…

jooq-developmentsqlemulationjavajooq

27 Feb 2018

1 min read

Index Developer Conference is a new conference organized by IBM to promote software development as a craft. The event took place at the Moscone Center, San Francisco, a popular software conference venue, on February 20-22, 2018. This was my first conference of the year and I was very excited about being invited to give 2 talks in 2...

javajava 9indextalkspeaking

lukaseder 1 min read

Sounds fancy, right? But it’s a really nice and reasonable approach to doing dynamic SQL with jOOQ. This blog post is inspired by a Stack Overflow question, where a user wanted to turn a set of values into a dynamic UNION query like this: Note, both the Stack Overflow user and I are well aware … Continue reading Map Reducing…

javajava 8java 9jooq-in-usesql

23 Feb 2018

lukaseder 1 min read

In most cases, natural sorting by sorting lexicographically is useful as a default in Java. This includes sorting file names, which are sorted lexicographically as well. However, when we have version numbers in our files (such as a set of SQL migration scripts), then we prefer the files to be sorted in a more intuitive … Continue reading How to…

javacomparatornatural orderorderingsemantic order

20 Feb 2018

lukaseder 1 min read

One of the biggest contributors to SQL syntax verbosity is the need to explicitly JOIN every table that somehow contributes to the query, even if that contribution is “trivial”. When looking at the Sakila database, an example could be seen easily when fetching customer data: That single access to the country information cost us 3 … Continue reading Type Safe…

javajooq-developmentsqldqlexplicit join

19 Feb 2018

6 Jan 2018

1 min read

Huge thanks to the Singapore Java User Group for having me as a speaker at their first event of 2018, Pivotal for hosting the event and providing pizza and drinks, as well as all the attendees for finding the time, all the positive feedback and good questions! Despite taking place early in the new year, the event...

javajava 9singajugtalkspeaking

15 Dec 2017

lukaseder 1 min read

When working with Oracle stored procedures, it is not uncommon to have debug log information available from DBMS_OUTPUT commands. For instance, if we have a procedure like this: The procedure works just the same, regardless if we’re reading the output from the DBMS_OUTPUT call. It is there purely for logging purposes. Now, if we call … Continue reading How to…

javajooq-developmentsqldbms outputjdbc

14 Dec 2017

lukaseder 1 min read

Caching is hard in various ways. Whenever you’re caching things, you have to at least think of: Memory consumption Invalidation In this article, I want to show a flaw that often sneaks into custom cache implementations, making them inefficient for some execution paths. I’ve encountered this flaw in Eclipse, recently. What did Eclipse do wrong? … Continue reading A Common…

javabugcache hitcache misscaching

28 Nov 2017

lukaseder 1 min read

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…

javaanimal snifferbackwards compatibilityjava 6java 7

20 Nov 2017

lukaseder 1 min read

After the successful release of JDK 9, we can already look forward, and play around with early access releases of JDK 10. The list of JEPs currently targeted for JDK 10 is quite manageable so far. JEP 286 is probably the most exciting one for most Java developers: Local variable type inference (which we’ve blogged … Continue reading Using JDK…

javajava 10final varjep 286jooq

11 Nov 2017

1 min read

In the previous post in this series, we examined features of the Stream API added in Java 9. A very useful API that plays well with streams, and was, in fact, used to make streams more robust, is Optional. Let’s explore it with JShell! Optional provides a container that may or may not contain a...

java 9java

10 Nov 2017

1 min read

In the last post in this series, we took a look at the new convenience factory methods for collections in Java 9. Collections play well with the Stream API, which learned a few new tricks since its introduction in Java 8 as well. There are 4 particularly exciting new features – let’s explore them with JShell! <h2...

java 9java

7 Nov 2017

Schakko 4 min read

One of the common required tasks for an application using a persistence store is to initialize the underlying database with basic data sets. Most of the time this contains something like admin users or default roles. Setting the stage To give a proper example, we have the database table role […] The post How to programtically insert versionized initial data…

java

1 Nov 2017

lukaseder 1 min read

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…

javajooq-developmentbenchmarksjava 8java 9

11 Oct 2017

lukaseder 1 min read

What’s better? Using the JDK’s String.replace() or something like Apache Commons Lang’s Apache Commons Lang’s StringUtils.replace()? In this article, I’ll compare the two, first in a profiling session using Java Mission Control (JMC), then in a benchmark using JMH, and we’ll see that Java 9 heavily improved things in this area. Profiling using JMC In … Continue reading Benchmarking JDK…

javajava 8java 9apache commons langbenchmark

24 Aug 2017

lukaseder 1 min read

One of the cooler hidden features in jOOQ is the JPADatabase, which allows for reverse engineering a pre-existing set of JPA-annotated entities to generate jOOQ code. For instance, you could write these entities here: (Just a simple example. Let’s not discuss the caveats of @ManyToMany mapping). For more info, the full example can be found … Continue reading jOOQ 3.10…

javajooq-in-usejpaattributeconverterhibernate

20 Jul 2017

lukaseder 1 min read

Java’s visibility rules are tricky at times. Do you know what this will print? It will print (highlight to see the solution): B.x Because: The super type B's members hide the enclosing type C's members, which again hide the static import from A. How can this lead to bugs? The problem isn’t that the above … Continue reading A Curious…

javainheritancelanguagesubtypesubtype polymorphism

18 Jul 2017

lukaseder 1 min read

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…

javabreakcargo cultcontinuelabel

14 Jul 2017

lukaseder 1 min read

Every now and then, I tweet something like this, just to piss off some clean coders: Call me what you want, but I like the occasional break-out-of-if pic.twitter.com/kQ0BIkijz0 — Lukas Eder (@lukaseder) July 13, 2017 Apart from the obvious trolling factor (why can’t I ever resist?), I do think there’s something thought provoking in such … Continue reading Don’t Extract…

javabreakcontinuecontrol flowexceptions

13 Jul 2017

lukaseder 1 min read

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…

javajdbcjooqsql serverstatement batches

29 Jun 2017

lukaseder 1 min read

In recent days, I’ve seen a bit too much of this: Something is very wrong with the above example. Can you see it? No? Let me rename those variables for you. Better now? Exactly. The above algorithm is O(N) when it could be O(1): (Let’s assume the lack of explicit ordering is irrelevant) I’m working … Continue reading A Basic…

javasqlalgorithmic complexityperformancestream

28 Jun 2017

lukaseder 1 min read

In this article, I will establish how the SQL language and its implementations distinguish between changed values and modified values, where a changed value is a value that has been “touched”, but not necessarily modified, i.e. the value might be the same before and after the change. Many ORMs, unfortunately, either update all of a … Continue reading ORMs Should…

javasqlactive recordhibernatejooq

9 Jun 2017

lukaseder 1 min read

It was hard to limit ourselves to 10 Nice Examples of Writing SQL in Kotlin With jOOQ, recently, because the Kotlin language has many nice little features that really help a lot when working with Java libraries. We’ve talked about the nice with() stdlib function, which allows to “import” a namespace for a local scope … Continue reading Using Kotlin’s…

kotlindynamic sqljavajooq

9 May 2017

lukaseder 1 min read

I was recently asked in an interview about my opinion on how to be a great programmer. That’s an interesting question, and I think we can all be great programmers, regardless of our talent, if we follow a couple of rules that – I believe – should be common sense. In fact, these rules don’t … Continue reading 10 Tips…

javaprofessionalprogramming

23 Apr 2017

jonskeet 6 min read

This post is an attempt to reduce the number of times I need to explain things in Stack Overflow comments. You may well be reading it via a link from Stack Overflow – I intend to refer to this post frequently in comments. Note that this post is mostly not about text handling – see … Continue reading All about…

javastack overflow

20 Mar 2017

lukaseder 1 min read

jOOQ is a library that loves making everything internal final and package private. We have tons of classes like these: The class implements the semantics of SQL string concatenation. Clearly, you shouldn’t need to tamper with it (or even know about it), because it is “protected” behind the corresponding public API in the DSL class: … Continue reading The Open-Closed…

javadesign principlesfinalopen-closedsolid

17 Mar 2017

17 Feb 2017

lukaseder 1 min read

An interesting question was asked on reddit’s /r/java recently: Should Iterators be used to modify a custom Collection? Paraphrasing the question: The author wondered whether a custom java.util.Iterator that is returned from a mutable Collection.iterator() method should implement the weird Iterator.remove() method. A totally understandable question. What does Iterator.remove() do? Few people ever use this … Continue reading Should I…

javajava 8arcaneiteratoriterator.remove

6 Jan 2017

lukaseder 1 min read

One of jOOQ‘s most powerful features is the capability of introducing custom data types, pretending the database actually understands them. For instance, when working with SQL TIMESTAMP types, users mostly want to use the new JSR-310 LocalDateTime, rather than the JDBC java.sql.Timestamp type. In jOOQ 3.9+, this is a no brainer, as we’ve finally introduced … Continue reading How to…

javajooq-developmentconvertercustom typesjooq

5 Jan 2017

lukaseder 1 min read

In a recent consulting gig, I was analysing a client’s connection pool issue in a productive system, where during some peak loads, all the Java processes involving database interactions just started queueing up until nothing really worked anymore. No exceptions, though, and when the peak load was gone in the evening, everything returned back to … Continue reading How to…

javaconnection pooldatasourcejdbcjooq

15 Dec 2016

lukaseder 1 min read

This is one of software engineering’s oldest battles. No, I’m not talking about where to put curly braces, or whether to use tabs or spaces. I mean the eternal battle between nominal typing and structural typing. This article is inspired by a very vocal blogger who eloquently reminds us to … […] Please Avoid Functional … Continue reading Do You…

javanaming thingsnominal typingstructural typing

14 Dec 2016

lukaseder 1 min read

Recently, at Devoxx, I’ve seen this beautiful slide in a talk by Kevlin Henney In his talk, he was displaying a variety of approaches to solve the FizzBuzz “problem”, including a couple of very elegant solutions in completely declarative approaches and languages. In this particular slide, Kevlin used a notation that is derived from maths. … Continue reading SQL, Streams,…

javasql4gldeclarative programmingfor comprehension

5 Dec 2016

lukaseder 1 min read

As long as we allow ourselves to write string-based dynamic SQL embedded in other programming languages like Java, we will have a certain risk of being vulnerable to SQL injection. That’s a fact. Don’t believe it? Check out this website exposing all vulnerabilities on Stack Overflow for PHP questions: https://laurent22.github.io/so-injections In a previous blog post, … Continue reading Prevent SQL…

javasqljooqsecuritysql injection

2 Nov 2016

lukaseder 1 min read

I’m very happy to have another interesting blog post by Vlad Mihalcea on the jOOQ blog, this time about his Open Source library flexypool. Read his previous jOOQ Tuesdays post on Hibernate here. Vlad is a Hibernate developer advocate and he’s the author of the popular book High Performance Java Persistence, and he knows 1-2 … Continue reading Applying Queueing…

javasqlerlangflexypoolhibernate

27 Sept 2016

lukaseder 1 min read

A recent question on Stack Overflow about jOOQ caught my attention. The question essentially asked: Why do both of these loops work? And indeed, just like in PL/SQL, you can use any jOOQ ResultQuery as a Java 5 Iterable, because that’s what it is. An Iterable<R> where R extends Record. The semantics is simple. When … Continue reading A Hidden…

javajava 8sqlcursorforeach

15 Sept 2016

Miguel Juárez López 5 min read

Using RxJava’s Observable.fromAsync() to convert asynchronous APIs while properly dealing with backpressure Since we started using RxJava in our Yammer Android app we’ve often encountered APIs that don’t follow its reactive model, requiring us to do some conversion work to integrate them with the rest of our RxJava Observable chains. APIs usually offer one of these two options when dealing…

androidjavaandroiddevrxjavaandroid-app-development

29 Aug 2016

lukaseder 1 min read

With Java 8 being mainstream now, people start using Streams for everything, even in cases where that’s a bit exaggerated (a.k.a. completely nuts, if you were expecting a hyperbole here). For instance, take mykong’s article here, showing how to collect a Map’s entry set stream into a list of keys and a list of values: … Continue reading Using jOOλ…

javajava 8collectorsjoomap

11 Aug 2016

lukaseder 1 min read

This hilarious article with a click-bait title caught my attention, recently: View at Medium.com A hilarious (although not so true or serious) rant about the current state of JavaScript development in the node ecosystem. Dependency hell isn’t new Dependency hell is a term that made it into wikipedia. It defines it as such: Dependency hell … Continue reading All Libraries…

javadependenciesdependency helllibrarieslibrary developers

19 Jul 2016

lukaseder 1 min read

“Challenge accepted” said Tagir Valeev when I recently asked the readers of the jOOQ blog to show if the Java JIT (Just-In-Time compilation) can optimise away a for loop. Tagir is the author of StreamEx, very useful Java 8 Stream extension library that adds additional parallelism features on top of standard streams. He’s a speaker … Continue reading The Java…

javajava 8jitoptimizationtagir valeev

7 Jul 2016

lukaseder 1 min read

Catchy headline, yes. But check out this Stack Overflow question by user Mike: (I’m duplicating it here on the blog, as it might be deleted soon) It’s a pretty open ended question. I’ll be starting out a new project and am looking at different ORMs to integrate with database access. Do you have any favorites? … Continue reading “What Java…

javajpasqljooq

Schakko 1 min read

For our internal search engine I am currently developing a simple microservice to make our CMDBuild instance searchable. The microservice provides a fairly simple JSON API which itself queries the REST API of CMDBuild. Because of the insufficient documentation of CMDBuild I had to dig into the the source how […] The post Executing a CQL wildcard search in CMDBuild’s…

java

4 Jul 2016

lukaseder 1 min read

A recent article about various ways to implement structural pattern matching in Java has triggered my interest: http://blog.higher-order.com/blog/2009/08/21/structural-pattern-matching-in-java The article mentions a Scala example where a tree data structure can be traversed very easily and neatly using Scala’s match keyword, along with using algebraic data types (more specifically, a sum type): Even if you’re not … Continue reading How Functional…

javajava 8design patternsfunctional programminggof

21 Jun 2016

lukaseder 1 min read

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:…

javajooq-tuesdayssqlhibernatehibernate performance

19 May 2016

Gary Spillman 15 min read

What is Load Testing and Why Should I Care? Somewhere between the disciplines of Dev Operations, Database Management, Software Design and Testing, there’s a Venn diagram where at its crunchy, peanut-butter filled center lies the discipline of performance testing. Herein lies the performant (sic) Which is to say, professional performance testers have a very specific […]

testingapachejavajmeter

12 May 2016

lukaseder 1 min read

We’re excited to announce another very interesting guest post on the jOOQ Blog by John Mcclean from AOL. AOL is a global digital media and technology company, founded in 1985 and once known as America Online, AOL is now part of the Verizon Group. AOL focuses on four areas – video, mobile, ad technology and … Continue reading Cyclops-react Organises…

javajava 8aolcyclopsjohn mcclean

9 May 2016

lukaseder 1 min read

Java 8 introduced JSR-308, which added new annotation capabilities to the Java language. Most importantly: Type annotations. It is now possible to design monsters like the below: The code displayed in that tweet really compiles. Every type can be annotated now, in order to enhance the type system in any custom way. Why, you may … Continue reading JSR-308 and…

javajava 8jooq-developmentannotatiomaniaannotations

21 Apr 2016

lukaseder 1 min read

A very interesting question was posted to Stack Overflow and reddit just recently about Java generics. Consider the following method: While the unsafe cast seems a bit wonky, and you might guess there’s something wrong here, you can still go ahead and compile the following assignment in Java 8: This is obviously wrong, because Integer … Continue reading The Parameterless…

javajava 8generics

19 Apr 2016

lukaseder 1 min read

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. We have the pleasure … Continue reading jOOQ Tuesdays:…

java 8jooq-tuesdaysjavajinqjooq

13 Apr 2016

lukaseder 1 min read

In the context of a previous blog post about JUnit 5, Maaartinus, one of our readers, has brought up a very interesting idea: The only problem with try-catch is its verbosity, which is something I can live with (IMHO a lone catch would do better, the implicit try would apply to all preceding code in … Continue reading Would We…

javaanonymous blockcatch blockinitialisersmethods

29 Mar 2016

lukaseder 1 min read

An interesting question by Tagir Valeev on Stack Overflow has recently caught my attention. To keep things short (read the question for details), while the following code works: printing 1 2 3 4 5 The following, similar code won’t work: Causing a StackOverflowError. Sure, this kind of recursive iteration is not optimal. It wasn’t prior … Continue reading Watch Out…

javajava 8java 9lambda expressionstream

10 Mar 2016

lukaseder 1 min read

News could hardly get more exciting than this, for a programming language aficionado! There is now a JEP 286 for Local-Variable Type Inference with status “Candidate”. And a request for feedback by Brian Goetz, which I would love to invite you to participate in: http://mail.openjdk.java.net/pipermail/platform-jep-discuss/2016-March/000037.html Please do so, the survey remains open only from March … Continue reading Java 10’s…

javajava 8declaration-site variancejava alocal variable type inference

7 Mar 2016

lukaseder 1 min read

Good decisions come from experience. Experience comes from making bad decisions. ― Mark Twain Today, let’s look at one piece of experience and how we can turn that into good decisions when implementing UI logic. Please, all UI developers read this. The bad decision When UI developers display tabular data, it is very common for … Continue reading UI Developers!…

javaascendingdefault sortingdescendingsort order

1 Mar 2016

lukaseder 1 min read

With jOOQ 3.7, we have finally added formal support for Java 8 features. This opened the door to a lot of nice improvements, such as: Creating result streams Calling statements asynchronously (jOOQ 3.8+) But obviously, we didn’t want to disappoint our paying customers who are stuck with Java 6 because of their using an older … Continue reading How to…

javajava 8java 9apijava 6

25 Feb 2016

lukaseder 1 min read

If you’re programming in more advanced languages like Scala or Ceylon, or even JavaScript, “nested functions” or “local functions” are a very common idiom to you. For instance, you’ll write things like fibonacci functions as such: (Question from Stack Overflow by Aaron Yodaiken) The f() function contains a nested g() function, which is local to … Continue reading (Ab)using Java…

java 8scalajavalocal functionlocal method

18 Feb 2016

lukaseder 1 min read

Have you been writing a lot of code following the Mute-Design-Pattern™ lately? E.g. There’s an easier way with Java 8! Just add this very useful tool to your Utilities or Helper class: Now you can wrap all your logic in this nice little wrapper: Done! Even better, in some cases, you can use method references

javajava 8trick

16 Feb 2016

11 Feb 2016

lukaseder 1 min read

Some APIs are set in stone. For instance, the JDK’s. Or public APIs, like the one between a database and a database client (e.g. JDBC). This makes designing such APIs rather difficult as a lot of thinking needs to be done prior to publishing an API. Which means that being defensive when designing the API … Continue reading Dear API…

javaapi designparameter objectreturn object

8 Feb 2016

lukaseder 1 min read

One of the most awesome features of the Oracle database is Oracle AQ: Oracle Database Advanced Queuing. The AQ API implements a full fledged, transactional messaging system directly in the database. In a classic architecture where the database is at the center of your system, with multiple applications (some of which written in Java, others … Continue reading Using Oracle…

javajava 8jooq-developmentinfinite streamjooq

26 Jan 2016

lukaseder 1 min read

Recently, we’ve published our article about the awesome window function support in jOOλ 0.9.9, which I believe is some of the best additions to the library that we’ve ever done. Today, we’ll look into an awesome application of window functions in a use-case that is inspired by this Stack Overflow question Sean Nguyen: How to … Continue reading How to…

java 8joojavawindow functions

20 Jan 2016

lukaseder 1 min read

Sometimes, when we get pull requests for jOOQ or our other libraries, people change the code in our unit tests to be more “idiomatic JUnit”. In particular, this means that they tend to change this (admittedly not so pretty code): … into this, “better” and “cleaner” version: What have we gained? Nothing! Sure, we already … Continue reading Use JUnit’s…

javajava 8annotatiomaniaannotationsjunit

14 Jan 2016

lukaseder 1 min read

Notice that the examples in this article may be outdated, as Typesafe’s Activator works differently now. The blog post will not be maintained to provide up-to-date Activator examples. We’re very happy to continue our a guest post series on the jOOQ blog by Manuel Bernhardt. In this blog series, Manuel will explain the motivation behind … Continue reading Reactive Database…

javascalasqlakkajooq

12 Jan 2016

lukaseder 1 min read

Java has come a long way. A very long way. And it carries with it all the “junk” from early day design decisions. One thing that has been regretted time and again is the fact that every object (potentially) contains a monitor. This is hardly ever necessary and this flaw was corrected, finally, in Java … Continue reading If Java…

javaconcurrencyforeachjava languagelanguage design

5 Jan 2016

lukaseder 1 min read

jOOQ is an internal domain-specific language (DSL), modelling the SQL language (external DSL) in Java (the host language). The main mechanism of the jOOQ API is described in this popular article: The Java Fluent API Designer Crash Course. Anyone can implement an internal DSL in Java (or in most other host languages) according to the … Continue reading A Curious…

javajooq-developmentapiapi designdomain specific language

29 Dec 2015

lukaseder 1 min read

I understand the idea of Java-the-language being rather hard to maintain in a backwards-compatible way. I understand the idea of JDK API, such as the collections, to be rather tough not to break. Yes. I don’t understand why Java still doesn’t have multiline string literals. How often do you write JDBC code (or whatever other … Continue reading Please, Java.…

javaescapingexternal languagesmultiline stringsregular expressions

22 Dec 2015

lukaseder 1 min read

Maintaining APIs is hard. We’re maintaining the jOOQ API which is extremely complex. But we are following relatively relaxed rules as far as semantic versioning is concerned. When you read comments by Brian Goetz and others about maintaining backwards-compatibility in the JDK, I can but show a lot of respect for their work. Obviously, we … Continue reading JEP 277…

javajava 9deprecationdrdeprecatorjep 277

16 Dec 2015

lukaseder 1 min read

Notice that the examples in this article may be outdated, as Typesafe’s Activator works differently now. The blog post will not be maintained to provide up-to-date Activator examples. We’re very happy to continue our a guest post series on the jOOQ blog by Manuel Bernhardt. In this blog series, Manuel will explain the motivation behind … Continue reading Reactive Database…

javascalasqlactorsfutures

Schakko 4 min read

I am currently working on the migration of our time tracking system from Microsoft SQL Server/.NET to Java. Most of the logic resides in Stored Procedures and Stored Functions inside the database schema. Because of some reasons (testability, maintainability, migration from MSSQL to PostgreSQL in a far future) the whole […] The post Executing Liquibase database migrations from command line…

java

15 Dec 2015

lukaseder 1 min read

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. We have the pleasure … Continue reading jOOQ Tuesdays:…

javajooq-tuesdaysasmaspectjbyte code

3 Dec 2015

lukaseder 1 min read

Notice that the examples in this article may be outdated, as Typesafe’s Activator works differently now. The blog post will not be maintained to provide up-to-date Activator examples. We’re very happy to announce a guest post series on the jOOQ blog by Manuel Bernhardt. In this blog series, Manuel will explain the motivation behind so-called … Continue reading Reactive Database…

javascalasqlasyncasynchronous programming

2 Dec 2015

lukaseder 1 min read

A nice feature of the Java 7 try-with-resources statement and the AutoCloseable type that was introduced to work with this statement is the fact that static code analysis tools can detect resource leaks. For instance, Eclipse: When you have the above configuration and you try running the following program, you’ll get three warnings: The output … Continue reading A Subtle…

javajava 8jooq-in-useautocloseablejava 7

14 Nov 2015

Schakko 3 min read

Yesterday my team had the situation that a deployment failed with a NoSuchMethodError, specifically the method com/google/common/collect/ImmutableList.copyOf could not be found while querying the Confluence REST API. NoSuchMethodEror and NoSuchMethodException occur of obvious reasons: a method should be called during runtime but the providing class does not contain the method. NoSuchMethodExceptions […] The post How to fix NoSuchMethodError or NoSuchMethodException…

java

22 Oct 2015

lukaseder 1 min read

Java 8 has lambdas and streams, but no tuples, which is a shame. This is why we have implemented tuples in jOOλ – Java 8’s missing parts. Tuples are really boring value type containers. Essentially, they’re just an enumeration of types like these: Writing tuple classes is a very boring task, and it’s best done … Continue reading The Danger…

javajava 8joofunctional programmingstreams

9 Oct 2015

lukaseder 1 min read

Java EE ships with its own persistence API: JPA. JPA is most powerful when you want to map your RDBMS entities (tables / relations) to Java entities (classes), mostly following a 1:1 mapping strategy. The idea behind this is that often, business logic isn’t really set-oriented as relational algebra or SQL, but record-oriented, meaning that … Continue reading A Beginner’s…

javajpaarun guptacdiejb

30 Sept 2015

lukaseder 1 min read

Exciting times are ahead for Java/SQL developers. SQL is strong and popular as ever. It is the right language for relational databases just as much as for Big Data storage systems. Just this week, Pivotal has announced their open sourcing HAWQ and MADlib as a part of their Hadoop Native SQL strategy. At Data Geekery, … Continue reading Let’s Meet…

sqljavajaxlondonjooqsql workshop

24 Sept 2015

lukaseder 1 min read

We’re very happy to announce a guest post by Marco Behler, who has been blogging about jOOQ in the past. Marco started out in programming (reverse-engineering, actually) and now mainly programmes on the JVM in his day-to-day work. He also always had a sweet tooth for strategy and marketing. Marco Behler GmbH is the result … Continue reading It is…

javasqlconnection poolinghibernatejdbc

17 Sept 2015

lukaseder 1 min read

Mario Fusco’s popular tweet impressively shows what the main difference between imperative and functional approaches to similar algorithms really is: Imperative vs. Functional – Separation of Concerns pic.twitter.com/G2cC6iBkDJ — Mario Fusco 🇪🇺 (@mariofusco) March 1, 2015 Both algorithms do the same thing, they’re probably equally fast and reasonable. Yet, one of the algorithms is much … Continue reading Comparing Imperative…

javajava 8functional programmingimperative programming

9 Sept 2015

lukaseder 1 min read

I’ve stumbled upon an interesting Stack Overflow question by user “mip”. The question was: I’m looking for a way of generating an alphabetic sequence: A, B, C, ..., Z, AA, AB, AC, ..., ZZ. This can be quickly recognised as the headings of an Excel spreadsheet, which does precisely that: . So far, none of … Continue reading How to…

javajava 8crossjoinflatmapfoldleft

26 Aug 2015

lukaseder 1 min read

Much of the ORM criticism of the last decade missed the point, being inaccurate. By the end of this article, we will conclude with the following: There is no significant difference between the relational (data) model and object oriented models How to come to this conclusion? Read on! How we came to believe in this … Continue reading There is…

sqlcubridfunctional programminginformixjava

20 Aug 2015

lukaseder 1 min read

Our recent article “NULL is Not The Billion Dollar Mistake. A Counter-Rant” got us a lot of reads, controversial comments, and a 50/50 upvote / downvote ratio pretty much everywhere a blog post can be posted and voted on. This was expected. Objectively, NULL is just a “special” value that has been implemented in a … Continue reading Divided we…

javajava 8nulloptional

13 Aug 2015

lukaseder 1 min read

Functional programming allows for quasi-declarative programming in a general purpose language. By using powerful fluent APIs like Java 8’s Stream API, or jOOλ’s sequential Stream extension Seq or more sophisticated libraries like vavr or functionaljava, we can express data transformation algorithms in an extremely concise way. Compare Mario Fusco’s imperative and functional version of the … Continue reading Common SQL…

javajava 8sqljoostreams

11 Aug 2015

lukaseder 1 min read

After coding for a while (eek, almost 20 years or so in my case, time flies when you’re having fun), one starts to embrace those habits. Because, you know… Anything that Can Possibly Go Wrong, Does. This is why people embrace “defensive programming”, i.e. paranoid habits that sometimes make total sense, and sometimes are rather … Continue reading Top 10…

javaaccidentsdefensive programmingmurphys lawparanoid programming

28 Jul 2015

lukaseder 1 min read

Method overloading has always been a topic with mixed feelings. We’ve blogged about it and the caveats that it introduces a couple of times: You Will Regret Applying Overloading with Lambdas! Keeping things DRY: Method overloading Why Everyone Hates Operator Overloading API Designers, be Careful There are two main reasons why overloading is useful: To … Continue reading Java 8’s…

javajava 8best practicesdefaulted parametersjosh bloch

22 Jul 2015

lukaseder 1 min read

A short while ago, I gave this answer on Quora. The question was “What is the significance of NULL in SQL?” and most of the existing answers went on about citing C.J. Date or Tony Hoare and unanimously declared NULL as “evil”. So, everyone rants about NULL all the time. Let me counter-rant. Academics Of … Continue reading NULL is…

javasqlnulloptionoptional

20 Jul 2015

lukaseder 1 min read

Oracle will remove the internal sun.misc.Unsafe class in Java 9. While most people are probably rather indifferent regarding this change, some other people – mostly library developers – are not. There had been a couple of recent articles in the blogosphere painting a dark picture of what this change will imply: Dripstat‘s Removal of sun.misc.Unsafe … Continue reading What the…

javajava 9backwards compatibilityceylonjdk 9

30 Jun 2015

lukaseder 1 min read

(Notice, this post has been written a while ago. jOOQ now supports JSR 310 data types) There was an interesting discussion recently on the jOOQ mailing list about jOOQ’s current lack of out-of-the-box support for TIMESTAMP WITH TIME ZONE data types. No one said that date, time and timezones are easy! There’s an amusing piece … Continue reading What’s Even…

javajava 8cestcetgmt

23 Jun 2015

lukaseder 1 min read

When running a Maven build with many plugins (e.g. the jOOQ or Flyway plugins), you may want to have a closer look under the hood to see what’s going on internally in those plugins, or in your extensions of those plugins. This may not appear obvious when you’re running Maven from the command line, e.g. … Continue reading How to…

javadebugeclipsemavenmaven opts

16 Jun 2015

lukaseder 1 min read

jOOQ is a great way to do SQL in Java and Quasar fibers bring a much improved concurrency We’re excited to announce another very interesting guest post on the jOOQ Blog by Fabio Tudone from Parallel Universe. Parallel Universe develops an open-source stack that allows developers to easily code extremly concurrent application on the JVM. … Continue reading Querying Your…

javajava 8blockingcomsatfabio tudone

21 May 2015

lukaseder 1 min read

Most of your code is private, internal, proprietary, and will never be exposed to public. If that’s the case, you can relax – you can refactor all of your mistakes, including those that incur breaking API changes. If you’re maintining public API, however, that’s not the case. If you’re maintaining public SPI (Service Provider Interfaces), … Continue reading Do Not…

javajava 8api evolutionspispi evolution

19 May 2015

lukaseder 1 min read

While the JVM is a stack-based machine, the Java language doesn’t really offer you any way to access that Stack. Even if sometimes, in rare occasions, it would be very useful. An example Method result values are put on the stack. If you look at the following example: If we ignore the halting problem, error … Continue reading How to…

javafinallyfinally-blockstack

14 May 2015

lukaseder 1 min read

Who doesn’t know them. The good old JFace dialogs in Eclipse that give you a visual representation of what is really a rather simple XML or properties file. In the case of m2e, it looks like this: Unfortunately, this screen is a bit slow to load, and it doesn’t offer much value beyond checking version … Continue reading Use This…

javaeclipsem2emaven

13 May 2015

lukaseder 1 min read

We’re very happy to announce a guest post on the jOOQ Blog written by Daniel Dietrich, Senior Software Engineer at HSH Nordbank, husband and father of three. He currently creates a pricing framework for financial products as project lead and lead developer. Besides his work, he is interested in programming languages, efficient algorithms and data … Continue reading Functional Programming…

javajava 8daniel dietrichfunctional programmingvavr

7 May 2015

lukaseder 1 min read

PostgreSQL has a lot of secret data types. In recent times, PostgreSQL’s JSON and JSONB support was hyped as being the NoSQL on SQL secret (e.g. as advertised by ToroDB) that allows you to get the best out of both worlds. But there are many other useful data types, among which the range type. How … Continue reading PostgreSQL’s Best-Kept…

javasqlbindingcustom data typesdata type binding

30 Apr 2015

lukaseder 1 min read

I admit, we’ve been lured into using this technique as well. It’s just so convenient, as it allows for avoiding a seemingly unnecessary cast. It’s the following technique here: Now you can type safely assign anything from the wrapper to any type: This is actually the API you can use when you’re using jOOR, our … Continue reading This Common…

javaantipatterncompilergenericstype safety

27 Apr 2015

lukaseder 1 min read

LOBs are a PITA in all databases, as well as in JDBC. Handling them correctly takes a couple of lines of code, and you can be sure that you’ll get it wrong eventually. Because you have to think of a couple of things: Foremost, LOBs are heavy resources that need special lifecycle management. Once you’ve … Continue reading Let’s Review…

javasqlblobclobjdbc

21 Apr 2015

lukaseder 1 min read

You wouldn’t believe it until you try it yourself. I’ve been using the Eclipse Mars developer milestones lately, and I’ve been having some issues with slow compilation. I always thought it was because of the m2e integration, which has never been famous for working perfectly. But then, it dawned upon me when I added a … Continue reading Is Your…

javajpaeclipseperformanceslow

14 Apr 2015

lukaseder 1 min read

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. We have the pleasure … Continue reading jOOQ Tuesdays:…

jooq-tuesdayshibernatejavajooq tuesdaysjpa

13 Apr 2015

lukaseder 1 min read

Syntax is one of those topics. One of those emotional topics that lead to very very very important discussions. I personally like PL/SQL. It is extremely verbose, and precise. It forces you to adhere to a very strong and rigid type system, slowing you down, which is likely to help you avoid mistakes. There is … Continue reading It’s the…

sqljavaoraclepl sqlsyntax

9 Apr 2015

lukaseder 1 min read

You’re not into the functional mood yet? Then the title might not resonate with you – but the article will! Trust me. Essentially, we want this: +------+------+------+ | col1 | col2 | col3 | +------+------+------+ | A | B | C | row 1 | D | E | F | row 2 | G … Continue reading How to…

javajava 8jdbcjooqresultset

2 Apr 2015

lukaseder 1 min read

Imagine you have a list of items: (Don’t judge me. Books from this random book generator) Now you’d like to create a new list where the third item only is replaced by some new value: Of course, you could go and either modify the original list: … or create a copy of the original list … Continue reading How to…

javajava 8joostreams api

1 Apr 2015

lukaseder 1 min read

I’ve recently had a very interesting discussion with Sebastian Gruber from Ergon, a very early jOOQ customer, whom we’re in close touch with. Talking to Sebastian has lead our engineering team to the conclusion that we should completely rewrite the jOOQ API. Right now, we already have lots of generics for various purposes, e.g. Generics … Continue reading Don’t be…

javajooq-developmentbackwards compatibilitygeneric genericsgeneric types

26 Mar 2015

lukaseder 1 min read

Some queries shouldn’t hit the database all the time. When you query for master data (such as system settings, languages, translations, etc.), for instance, you may want to avoid sending the same silly query (and the results) over the wire all the time. For example: Most databases maintain buffer caches to accelerate these queries, so … Continue reading Hack up…

javajava 8sqlcachejdbc

24 Mar 2015

lukaseder 1 min read

Hibernate has become a de-facto standard in the Java ecosystem, and after the fact, also an actual JavaEE standard implementation if standards matter to you, and if you put the JCP on the same level with ISO, ANSI, IEEE, etc. This article does not intended to discuss standards, but visions. Hibernate shares JPA’s vision of … Continue reading jOOQ vs.…

javasqlhibernatejooqorm

9 Mar 2015

lukaseder 1 min read

Yak Shaving (uncountable): (idiomatic) Any apparently useless activity which, by allowing you to overcome intermediate difficulties, allows you to solve a larger problem. (idiomatic) A less useful activity done to consciously or unconsciously procrastinate about a larger but more useful task. Both interpretations of the term Yak Shaving as explained by Wiktionary are absolutely accurate … Continue reading Yak Shaving…

javaopen-sourceapi designdevelopmentrefactoring

5 Mar 2015

lukaseder 1 min read

I’ve recently stumbled upon a very interesting caveat of the JDK APIs, the Class.getConstructors() method. Its method signature is this: Constructor<?>[] getConstructors() The interesting thing here is that Class.getConstructor(Class...) returns a Constructor<T>, with <T> being maintained: Constructor<T> getConstructor(Class<?>... parameterTypes) Why is there a difference, i.e. why doesn’t the first method return Constructor<T>[]? Let’s consider the … Continue reading The Java…

javabackwards compatibilitybrian goetz

2 Mar 2015

lukaseder 1 min read

We’ve published an article in the German magazine www.java-aktuell.de, which is published by the iJUG e.V.. You can read and download the article free of charge from our blog! In Java gibt es kein Standard-API, das die Ausdrucksstärke und Mächtigkeit von SQL direkt unterstützt. Alle Aufmerksamkeit ist auf objekt-relationales Mapping und andere höhere Abstraktionslevel gerichtet, … Continue reading jOOQ –…

javasqljava aktuelljooq

24 Feb 2015

lukaseder 1 min read

Every framework introduces a new compromise. A compromise that is introduced because the framework makes some assumptions about how you’d like to interact with your software infrastructure. An example of where this compromise has struck users recently is the discussion “Are Slick queries generally isomorphic to the SQL queries?“. And, of course, the answer is: … Continue reading jOOQ vs.…

javascalajooqormslick

18 Feb 2015

lukaseder 1 min read

(unless you really override Object.equals(), of course). I’ve stumbled upon a rather curious Stack Overflow question by user Frank: Why does Java’s Area#equals method not override Object#equals? Interestingly, there is a Area.equals(Area) method which really takes an Area argument, instead of a Object argument as declared in Object.equals(). This leads to rather nasty behaviour, as … Continue reading Thou Shalt…

javaawtequalshashcodeoverloading

17 Feb 2015

lukaseder 1 min read

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. We have the pleasure … Continue reading jOOQ Tuesdays:…

jooq-tuesdaysjames goughjavajava 8jooq tuesdays

5 Feb 2015

lukaseder 1 min read

There has been a lot of hype about the buzzword “web scale“, and people are going through lengths of reorganising their application architecture to get their systems to “scale”. But what is scaling, and how can we make sure that we can scale? Different aspects of scaling The hype mentioned above is mostly about scaling … Continue reading Top 10…

javajava 8anti-patternsenummapenumset

2 Feb 2015

lukaseder 1 min read

There has been an interesting discussion on reddit, the other day Static Inner Classes. When is it too much? First, let’s review a little bit of basic historic Java knowledge. Java-the-language offers four levels of nesting classes, and by “Java-the-language”, I mean that these constructs are mere “syntax sugar”. They don’t exist in the JVM, … Continue reading Top 5…

javaanonymous classesinner classeslocal classesnested classes

29 Jan 2015

lukaseder 1 min read

Writing good APIs is hard. Extremely hard. You have to think of an incredible amount of things if you want your users to love your API. You have to find the right balance between: Usefulness Usability Backward compatibility Forward compatibility We’ve blogged about this topic before, in our article: How to Design a Good, Regular … Continue reading You Will…

javajava 8apiapi designapi evolution

23 Jan 2015

21 Jan 2015

lukaseder 1 min read

Subscribe to this newsletter here Tweet of the Day Today, we’re very happy to have “spied” on our users as we can now show you a whole Tweet Conversation of the Day It was initiated by Dan Woods who proposed a talk about RxJava, jOOQ and Reactive Streams at GR8Conf. https://twitter.com/danveloper/status/553370842948567040 Dan Woods then proposed … Continue reading jOOQ Newsletter:…

jooq-newsletterconverterprivdergroovyhanajava

19 Jan 2015

lukaseder 1 min read

Some logs are there to be consumed by machines and kept forever. Other logs are there just to debug and to be consumed by humans. In the latter case, you often want to make sure that you don’t produce too much logs, especially not too wide logs, as many editors and other tools have problems … Continue reading Using Java…

javajava 8loggingstring manipulation

16 Jan 2015

lukaseder 1 min read

A wise man once said: Anything that can possibly go wrong, does — Murphy Some programmers are wise men, thus a wise programmer once said: A good programmer is someone who looks both ways before crossing a one-way street. — Doug Linder In a perfect world, things work as expected and you may think that … Continue reading Infinite Loops.…

javabugcoding standardscoding styleinfinite loops

8 Jan 2015

lukaseder 1 min read

In the recent past, we’ve shown how Java 8 and functional programming will bring a new perspective to Java developers when it comes to functional data transformation of SQL data using jOOQ and Java 8 lambdas and Streams. Today, we take this a step further and transform the data into JavaFX XYChart.Series to produce nice-looking … Continue reading Transform Your…

java 8sqlbar chartsjavajavafx

29 Dec 2014

lukaseder 1 min read

We’ve recently published an article about how to bind the Oracle DATE type correctly in SQL / JDBC, and jOOQ. This article got a bit of traction on reddit with an interesting remark by Vlad Mihalcea, who is frequently blogging about Hibernate, JPA, transaction management and connection pooling on his blog. Vlad pointed out that … Continue reading Leaky Abstractions,…

javasqlhibernateinternal functionjpa

15 Dec 2014

lukaseder 1 min read

This is one of the more interesting recent Stack Overflow questions: Why does Iterable not provide stream() and parallelStream() methods? At first, it might seem intuitive to make it straight-forward to convert an Iterable into a Stream, because the two are really more or less the same thing for 90% of all use-cases. Granted, the … Continue reading Really Too…

javajava 8brian goetzintstreamiterable

11 Dec 2014

lukaseder 1 min read

Sometimes there are these moments of truth. They happen completely unexpectedly, such as when I read this tweet: Good discussion of Facebook Flow – http://t.co/5KTKakDB0w — David J. Pearce (@whileydave) November 23, 2014 David is the author of the lesser-known but not at all lesser-interesting Whiley programming language, a language that has a lot of … Continue reading The Inconvenient…

javasqlceylondavid pearcedynamic typing

8 Dec 2014

lukaseder 1 min read

From time to time, I find someone using the double curly braces anti pattern (also called double brace initialisation) in the wild. This time on Stack Overflow: In case you do not understand the syntax, it’s actually easy. There are two elements: We’re creating anonymous classes that extend HashMap by writing In that anonymous class, … Continue reading Don’t be…

javaanonymous classesanti patterndouble brace initialisationdouble curly braces anti pattern

2 Dec 2014

lukaseder 1 min read

According to a recent survey by ZeroTurnaround’s RebelLabs, Maven is still the leading Java build platform. The current market share distribution, according to RebelLabs is: Maven with 64% Ant + Ivy with 16.5% Gradle with 11% Yet, at the same time, Maven is often criticised for being a bit obscure and intrusive. Compared to runner-ups … Continue reading How to…

javabintraycommercial artefactsgradlejdbc

7 Nov 2014

lukaseder 1 min read

If you’re using a commercial database or PostgreSQL / Firebird / CUBRID, you will be able to take advantage of the full power of window functions. We’ve blogged about window functions’ awesomeness a couple of times, in particular about ROW_NUMBER(), RANK(), DENSE_RANK(). Today, we’re going to look into some awesome window functions that produce values … Continue reading Don’t Miss…

sqlfirst valuejavajooqlag

4 Nov 2014

lukaseder 1 min read

A procedural language combined with SQL can do miracles in terms of productiveness, performance and expressivity. In this article, we’ll see later on, how we can achieve the same with SQL (and PL/SQL) in Java, using jOOQ, which offers much more functionality than Oracle’s own now desupported JPublisher. But first, a little bit of history… … Continue reading Access PL/SQL…

javajooq-in-usesqljdbcojdbc

3 Nov 2014

lukaseder 1 min read

So, you’ve been working with Java since the very beginning? Remember the days when it was called “Oak”, when OO was still a hot topic, when C++ folks thought that Java had no chance, when Applets were still a thing? I bet that you didn’t know at least half of the following things. Let’s start … Continue reading 10 Things…

funjavajava languagejlslanguage

31 Oct 2014

lukaseder 1 min read

The jOOQ ecosystem and community is continually growing. We’re personally always thrilled to see other Open Source projects built on top of jOOQ. Today, we’re very happy to introduce you to a very interesting approach at combining REST and RDBMS by Björn Harrtell. Björn Harrtell is a swedish programmer since childhood. He is usually busy … Continue reading A RESTful…

javajooq-in-usesqlhttpjdbc-http-server

23 Oct 2014

lukaseder 1 min read

I wanted to find an easy way to stream a Map in Java 8. Guess what? There isn’t! What I would’ve expected for convenience is the following method: But there’s no such method. There are probably a variety of reasons why such a method shouldn’t exist, e.g.: There’s no “clear” preference for entrySet() being chosen … Continue reading Let’s Stream…

javajava 8collectionsjdkjoo-lambda

17 Oct 2014

lukaseder 1 min read

A while ago, we have published this fun game we like to call Spring API Bingo. It is a tribute and flattery to Spring’s immense creativeness when forming meaningful class names like FactoryAdvisorAdapterHandlerLoader ContainerPreTranslatorInfoDisposable BeanFactoryDestinationResolver LocalPersistenceManagerFactoryBean Two of the above classes actually exist. Can you spot them? If no, play Spring API Bingo! Clearly, the … Continue reading The dreaded…

funjavabodyimplimplementation

2 Oct 2014

lukaseder 1 min read

More and more people are catching up with the latest update to our platform by adopting functional programming also for their businesses. At Data Geekery, we’re using Java 8 for our jOOQ integration tests, as using the new Streams API with lambda expressions makes generating ad-hoc test data so much easier. However, we don’t feel … Continue reading Don’t Miss…

javajava 8sqljoojooq

23 Sept 2014

lukaseder 1 min read

Reactive programming is the new buzzword, which essentially just means asynchronous programming or messaging. Fact is that functional syntax greatly helps with structuring asynchronous execution chains, and today, we’ll see how we can do this in Java 8 using jOOQ and the new CompletableFuture API. In fact, things are quite simple: What did really happen … Continue reading Asynchronous SQL…

javajava 8sqlasynchronouscompletablefuture

19 Sept 2014

17 Sept 2014

lukaseder 1 min read

It’s this time of the year and we’re repeating the silly metrics keyword count across all of jOOQ‘s code base. We have a couple of exciting news! public is still one of the favourite keywords (yeah, we’re an API), but return is closing in, as well as final (yeah, we love final). A bit more … Continue reading This Just…

funjavakeywordssilly metrics

15 Sept 2014

lukaseder 1 min read

Pun intended… Let’s discuss Java final. Recently, our popular blog post “10 Subtle Best Practices when Coding Java” had a significant revival and a new set of comments as it was summarised and linked from JavaWorld. In particular, the JavaWorld editors challenged our opinion about the Java keyword “final“: More controversially, Eder takes on the … Continue reading This is…

javaapi designfinalfinal keywordkeywords

10 Sept 2014

lukaseder 1 min read

Java 8 was – as always – a release of compromises and backwards-compatibility. A release where the JSR-335 expert group might not have agreed upon scope or feasibility of certain features with some of the audience. See some concrete explanations by Brian Goetz about why … … “final” is not allowed in Java 8 default … Continue reading When the…

javajava 8brian goetzfunctional programmingjoo

8 Sept 2014

lukaseder 1 min read

This recent question on Stack Overflow made me think. Why does jOOQ suggest to put generated code under “/target” and not under “/src”? … and I’m about to give you the final answer to “Where to Put Generated Code?” This isn’t only about jOOQ Even if you’re not using jOOQ, or if you’re using jOOQ … Continue reading Look no…

javagenerated codegenerated source codehibernatejooq

26 Aug 2014

lukaseder 1 min read

Introduction jOOQ is a great framework when you want to work with SQL in Java without having too much ORM in your way. At the same time, it can be integrated into many environments as it is offering you support for many database-specific features. One such database-specific feature is partitioning in PostgreSQL. Partitioning in PostgreSQL … Continue reading Integrating jOOQ…

javajooq-in-usejooqmulti-tenancypartitioning

1 Aug 2014

lukaseder 1 min read

So, I’m experimenting with Scala because I want to write a parser, and the Scala Parsers API seems like a really good fit. After all, I can implement the parser in Scala and wrap it behind a Java interface, so apart from an additional runtime dependency, there shouldn’t be any interoperability issues. After a few … Continue reading The 10…

javajava 8scala

28 Jul 2014

lukaseder 1 min read

jOOQ implements your SQL statements as AST (Abstract Syntax Tree). This means that your SQL statement is modelled in a non-text form prior to serialising it as a textual SQL statement to your JDBC driver. One advantage of this is that you can freely manipulate this AST any way you want. This can be done … Continue reading jOOQ Tip…

javajooq-in-usesqlabstract syntax treeast

21 Jul 2014

lukaseder 1 min read

A good clean application design requires discipline in keeping things DRY: Everything has to be done once. Having to do it twice is a coincidence. Having to do it three times is a pattern. — An unknown wise man Now, if you’re following the Xtreme Programming rules, you know what needs to be done, when … Continue reading Keeping things…

javacopy pastecopypastadrymethod overloading

11 Jul 2014

7 Jul 2014

lukaseder 1 min read

Table-valued functions are an awesome thing. Many databases support them in one way or another and so does PostgreSQL. In PostgreSQL, (almost) everything is a table. For instance, we can write: … and believe it or not, this is a table! We can write: And the above will return: +----+ | v2 | +----+ | … Continue reading PostgreSQL’s Table-Valued…

javajooq-developmentsqljooqpostgresql

26 Jun 2014

lukaseder 1 min read

Writing tests that use an actual database is hard. Period. Now that this has been established, let’s have a look at a blog post by Marco Behler, in which he elaborates on various options when testing database code, with respect to transactionality. Testing database transactions is even harder than just testing database code. Marco lists … Continue reading Stop Unit…

javasqldatabaseshibernateintegration testing

25 Jun 2014

lukaseder 1 min read

When performing database migrations, we at Data Geekery recommend using jOOQ with Flyway – Database Migrations Made Easy. In this post, we’re going to look into a simple way to get started with the two frameworks. Philosophy There are a variety of ways how jOOQ and Flyway could interact with each other in various development … Continue reading Flyway and…

javajooq-developmentmigrationssqldatabase migration

22 Jun 2014

20 Jun 2014

lukaseder 1 min read

At Data Geekery, we love Java. And as we’re really into jOOQ’s fluent API and query DSL, we’re absolutely thrilled about what Java 8 will bring to our ecosystem. Every Friday, we’re showing you a couple of nice new tutorial-style Java 8 features, which take advantage of lambda expressions, method references, default methods, the Streams … Continue reading Java 8…

bloggingjavajava 8blogsdefault methods

18 Jun 2014

lukaseder 1 min read

jOOQ Goes JavaOne™ We’re super excited to announce that our CEO and Head of R&D Lukas will be heading to San Francisco this fall to talk about jOOQ at JavaOne™! This is not just great for Data Geekery and jOOQ, but also for the whole Java / SQL ecosystem, as we believe that the Java / SQL … Continue reading…

jooq-newsletterdual-licensinge-pointjavajavaone

14 Jun 2014

lukaseder 1 min read

After deep consideration with our lawyers, we would like to follow suit with Oracle and provide you with the following legal disclaimer about our jOOQ-related conference talks, as presented at the awesome GeekOut conference in Tallinn. Please do read them and take them seriously.

funsqlconference talksdisclaimerjava

13 Jun 2014

lukaseder 1 min read

At Data Geekery, we love Java. And as we’re really into jOOQ’s fluent API and query DSL, we’re absolutely thrilled about what Java 8 will bring to our ecosystem. Java 8 Friday Every Friday, we’re showing you a couple of nice new tutorial-style Java 8 features, which take advantage of lambda expressions, extension methods, and … Continue reading Java 8…

javajava 8concurrencyinfinite streamsjooq

9 Jun 2014

6 Jun 2014

lukaseder 1 min read

At Data Geekery, we love Java. And as we’re really into jOOQ’s fluent API and query DSL, we’re absolutely thrilled about what Java 8 will bring to our ecosystem. Java 8 Friday Every Friday, we’re showing you a couple of nice new tutorial-style Java 8 features, which take advantage of lambda expressions, extension methods, and … Continue reading Java 8…

javajava 8javascriptjooqnashorn

30 May 2014

lukaseder 1 min read

At Data Geekery, we love Java. And as we’re really into jOOQ’s fluent API and query DSL, we’re absolutely thrilled about what Java 8 will bring to our ecosystem. Java 8 Friday Every Friday, we’re showing you a couple of nice new tutorial-style Java 8 features, which take advantage of lambda expressions, extension methods, and … Continue reading Java 8…

javajava 8dslsinternal dslsjava 8 friday

29 May 2014

lukaseder 1 min read

This week, Timo Westkämper from QueryDSL has announced feature completeness on the QueryDSL user group, along with his call for contributions and increased focus on bugfixes and documentation. Timo and us, we have always been in close contact, observing each other’s products. In the beginning of jOOQ in 2009, QueryDSL was ahead of us. But … Continue reading QueryDSL vs.…

javajooq-developmentsqlfeature completefeature-completeness

26 May 2014

lukaseder 1 min read

(Sorry for that click-bait heading. Couldn’t resist ;-) ) We’re on a mission. To teach you SQL. But mostly, we want to teach you how to appreciate SQL. You’ll love it! Getting SQL right or wrong shouldn’t be about that You’re-Doing-It-Wrong™ attitude that can be encountered often when evangelists promote their object of evangelism. Getting … Continue reading Yet Another…

javasqlboolean typecommon table expressionsconstraints

23 May 2014

lukaseder 1 min read

At Data Geekery, we love Java. And as we’re really into jOOQ’s fluent API and query DSL, we’re absolutely thrilled about what Java 8 will bring to our ecosystem. Java 8 Friday Every Friday, we’re showing you a couple of nice new tutorial-style Java 8 features, which take advantage of lambda expressions, extension methods, and … Continue reading Java 8…

javajava 8checked exceptionsconsumerexception

16 May 2014

lukaseder 1 min read

At Data Geekery, we love Java. And as we’re really into jOOQ’s fluent API and query DSL, we’re absolutely thrilled about what Java 8 will bring to our ecosystem. Java 8 Friday Every Friday, we’re showing you a couple of nice new tutorial-style Java 8 features, which take advantage of lambda expressions, extension methods, and … Continue reading Java 8…

javajava 8compilerfunctional interfacejava language specification

9 May 2014

lukaseder 1 min read

At Data Geekery, we love Java. And as we’re really into jOOQ’s fluent API and query DSL, we’re absolutely thrilled about what Java 8 will bring to our ecosystem. Java 8 Friday Every Friday, we’re showing you a couple of nice new tutorial-style Java 8 features, which take advantage of lambda expressions, extension methods, and … Continue reading Java 8…

javajava 8backwards compatibilitybrian goetzcommunity

7 May 2014

lukaseder 1 min read

I’ve recently stumbled upon this interesting Stack Overflow question, where the user essentially wanted to ensure that resulting records are delivered in a well-defined order. They wrote They got CE367FAACDHCANPH-151556 CE367FAACEX9ANPH-153877 GE526OTACCD3ANPH-149839 NI564FAACJSFANPH-162605 They wanted CE367FAACDHCANPH-151556 CE367FAACEX9ANPH-153877 NI564FAACJSFANPH-162605 GE526OTACCD3ANPH-149839 Very often, according to your business rules, sorting orders are not “natural”, as in numeric sortin

sqlcase expressionderived tablesjavajooq

5 May 2014

lukaseder 1 min read

Every now and then, I miss SQL’s three-valued BOOLEAN semantics in Java. In SQL, we have: TRUE FALSE UNKNOWN (also known as NULL) Every now and then, I find myself in a situation where I wish I could also express this UNKNOWN or UNINITIALISED semantics in Java, when plain true and false aren’t enough. Implementing … Continue reading Three-State Booleans…

javajava 8booleanjdbcjoo

2 May 2014

lukaseder 1 min read

At Data Geekery, we love Java. And as we’re really into jOOQ’s fluent API and query DSL, we’re absolutely thrilled about what Java 8 will bring to our ecosystem. Java 8 Friday Every Friday, we’re showing you a couple of nice new tutorial-style Java 8 features, which take advantage of lambda expressions, extension methods, and … Continue reading Java 8…

javajava 8apache commonsapache commons iobase 64

27 Apr 2014

Schakko 2 min read

Our current project uses JSF and CDI for the presentation layer. The business logic is encapsulated inside EJB with no-interface view as proposed by Adam Bien and others. I evaluated different alternatives for integration testing and ended up with Arquillian. For JSF/CDI based applications Arquillian is the best fit. As […] The post Doing integration tests with Arquillian and real…

javaarquilliancdiejbintegration test

9 Apr 2014

lukaseder 1 min read

On the TIOBE index, Java and C have been sharing the #1 and #2 rank for a long time now, and with the recent GA release of the JDK 8, things are not going to get any worse for our community. Java simply rocks! And it’s the best platform to build almost any of your … Continue reading Java Rocks…

javabackwards compatibilitybytecodecompilercore api

7 Apr 2014

lukaseder 1 min read

This is the list we’ve all been waiting for. The top 10 productivity booster techs for programmers that – once you’ve started using them – you can never do without them any longer. Here it is: 1. Git Before, there were various version control systems. Better ones, worse ones. But somehow they all felt wrong … Continue reading The Top…

javacssdevelopereclipseexcel

4 Apr 2014

lukaseder 1 min read

At Data Geekery, we love Java. And as we’re really into jOOQ’s fluent API and query DSL, we’re absolutely thrilled about what Java 8 will bring to our ecosystem. Java 8 Friday Every Friday, we’re showing you a couple of nice new tutorial-style Java 8 features, which take advantage of lambda expressions, extension methods, and … Continue reading Java 8…

javajava 8collections apidefault methodsfunctional interfaces

1 Apr 2014

lukaseder 1 min read

For the occasion of today’s date, I’ve just invented a fun game. The Spring API Bingo! How does it work? Let us write the following little piece of code: So far so good. We could use more terms if we wanted to but for now, these will suffice. Now, let’s shuffle the above list and … Continue reading Spring API…

funjava 8facebook bingojavamarkov-chain-generated api

28 Mar 2014

lukaseder 1 min read

At Data Geekery, we love Java. And as we’re really into jOOQ’s fluent API and query DSL, we’re absolutely thrilled about what Java 8 will bring to our ecosystem. Java 8 Friday Every Friday, we’re showing you a couple of nice new tutorial-style Java 8 features, which take advantage of lambda expressions, extension methods, and … Continue reading Java 8…

javajava 8ceyloncollections apielvis operator

24 Mar 2014

lukaseder 1 min read

When doing reporting or statistics with SQL, you better know your window functions. There are many of them, and few SQL developers know about them. CUME_DIST() is one such function. We’ve recently re-discovered it on Stack Overflow. The following query yields two times the same result for fraction1 and fraction2: The above query then yields: … Continue reading CUME_DIST(), a…

sqlcume disthypothetical set functionsjavajooq

21 Mar 2014

lukaseder 1 min read

At Data Geekery, we love Java. And as we’re really into jOOQ’s fluent API and query DSL, we’re absolutely thrilled about what Java 8 will bring to our ecosystem. For our Java 8 series, we’re honoured to host a very relevant guest post by Dr. Ming-Yee Iu. Dr. Ming-Yee Iu completed a PhD on Database … Continue reading Java 8…

javajava 8sqldatabase abstractiondatabase api

14 Mar 2014

lukaseder 1 min read

At Data Geekery, we love Java. And as we’re really into jOOQ’s fluent API and query DSL, we’re absolutely thrilled about what Java 8 will bring to our ecosystem. We have blogged a couple of times about some nice Java 8 goodies, and now we feel it’s time to start a new blog series, the… … Continue reading Java 8…

javajava 8concurrencyexecutorserviceforkjoin

12 Mar 2014

lukaseder 1 min read

Patterns 34:29 As Turing descended from Mount Compute – with the two iPads of the testimony in his hands as he descended the mountain – he did not realize that the skin of his blog shone as a result of his Compiling the Code. Patterns 35:1 Turing assembled the entire Geek community and said to … Continue reading The 10…

funjavabest practicesprogrammingthe 10 commandments

7 Mar 2014

lukaseder 1 min read

At Data Geekery, we love Java. And as we’re really into jOOQ’s fluent API and query DSL, we’re absolutely thrilled about what Java 8 will bring to our ecosystem. We have blogged a couple of times about some nice Java 8 goodies, and now we feel it’s time to start a new blog series, the… … Continue reading Java 8…

javajava 8jdbcjoo-lambdajoo

28 Feb 2014

lukaseder 1 min read

At Data Geekery, we love Java. And as we’re really into jOOQ’s fluent API and query DSL, we’re absolutely thrilled about what Java 8 will bring to our ecosystem. We have blogged a couple of times about some nice Java 8 goodies, and now we feel it’s time to start a new blog series, the… … Continue reading Java 8…

javajava 8cachingconcurrenthashmapfibonacci

26 Feb 2014

lukaseder 1 min read

Intuition tells us that methods like these ones suffer from a distinct code smell: Why is that so? Let’s delve into this intuition. Here is an example from the JavaCompiler Javadoc: So what’s wrong here? We have a lot of very disjunctly typed parameters that are very likely to be set to null. This decreases … Continue reading How to…

javacode analysiscohesionhigh cohesionjarchitect

25 Feb 2014

lukaseder 1 min read

Interestingly, boolean types have been introduced only late in the SQL standard, namely in SQL:1999. Even today, not all databases natively support BOOLEAN or BIT types. Most importantly, we can still wait for them in Oracle for a while. Here’s “Ask Tom”‘s point of view from 2002 on the subject: https://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:6263249199595 Oracle. Why U No … Continue reading The JDBC…

javasqlbooleanboolean data typecompatibility

24 Feb 2014

lukaseder 1 min read

Java 7 has eased some pain in the area of exception handling when the new try-with-resources and multi-catch syntaxes were introduced. The latter is very interesting from a syntax perspective because it is the only place in Java where formal union types are allowed, similar to what Ceylon offers. Remember, a union type A | … Continue reading Feature Request…

javaexceptionsjava languagejlssyntax

21 Feb 2014

lukaseder 1 min read

At Data Geekery, we love Java. And as we’re really into jOOQ’s fluent API and query DSL, we’re absolutely thrilled about what Java 8 will bring to our ecosystem. We have blogged a couple of times about some nice Java 8 goodies, and now we feel it’s time to start a new blog series, the… … Continue reading Java 8…

javajava 8lambda expressionsscopetransactions

18 Feb 2014

lukaseder 1 min read

Sometimes you have to hack. You just have to. Don’t listen to XKCD. You don’t always regret hacking. On our blog, we’ve shown a couple of hacks before: Throw checked exceptions like runtime exceptions in Java A dirt-ugly hack to modify private final fields in Java But we’ve just been scratching the surface. Our friends at ZeroTurnaround … Continue reading…

javajdkjvmrebellabsthe unsafe

17 Feb 2014

lukaseder 1 min read

Do you profile your code using JProfiler or YourKit? You should, because their licenses are worth every penny when you can find a very hidden and subtle bottleneck deep down in your application. For instance, the following chart shows nicely that there was a significant performance issue in jOOQ related to reflection: I’ll spare you … Continue reading Free Java…

javajava misison controljprofileroracleoracle java mission control

7 Jan 2014

Schakko 1 min read

Recently I struggled upon the same problem, this guy described. Our Oracle database instance contains multiple schematics with almost the same structure. Every developer has it’s own schema for unit and integration tests. On application startup the Hibernate schema validator calls the DatabaseMetaData.getTables() for every linked entity. The method returns the first […] The post Hibernate uses wrong schema during…

application serverdatabasesdatabasehibernatejava

24 Sept 2013

Schakko 2 min read

Our new project makes use of Maven as build management tool. Eclipse (STS edition) is used for the development process. A part of the project consists of a transformation process which converts XML files to Java POJOs. Because of the given XML structure we used JAXB in combination with EclipseLink […] The post Unit tests inside Eclipse succeed, unit tests…

javaclasspathecjjaxbmoxy

13 Oct 2010

Schakko 2 min read

Die letzten beiden Tage war ich damit beschäftigt, ein paar Evaluierungen für die .NET-Plattform zu machen. Eines unserer Projekte greift mit Hilfe eines (zugegebenermaßen ziemlich coolen) WPF-Frontends über WCF auf einen SOAP-Service zu, der die Verbindung zu einer MS SQL-Datenbank herstellt. Logging auf die Konsole Unter Java bzw. innerhalb eines […] The post .NET aus der Sicht eines Java-Entwicklers appeared…

application serverc#javamicrosoft.net

30 Sept 2010

Schakko 2 min read

Wenn man die grundlegende Funktionsweise von Spring MVC verstanden hat – ich empfehle an dieser Stelle die äußerst vorzügliche offizielle Dokumentation -, kommt man an den Punkt, an dem man auch Bilder oder Stylesheets in die Web-Applikation einbinden möchte. Dafür gibt es zwei Möglichkeiten. Spezifizieren eines eigenen URL-Suffixes für Request-Mappings […] The post Springs FrontController soll keine CSS-, PNG- oder…

application serverjavacontentcontrollercss

22 Aug 2010

Schakko 1 min read

Ich stand heute vor dem Problem, dass ich mit einem AspectJ-Advice die Parameter von Methoden überprüfen wollte. Abhängig von dem Parametertyp sollte eine Exception geworfen werden. Meine Exceptions erben von einer Basisklasse, die in Abhängigkeit des Parametertyps weitere Exception-Codes enthalten. So kann z.B. die UserException neben dem Code NOT_FOUND (Parameter […] The post AspectJ und Spring: Parameter einer Methode auslesen…

javaannotationaopargsargumente

26 Jul 2010

Schakko 7 min read

Einen meiner Azubis habe ich vor einigen Wochen die Aufgabe gegeben, sein in Java geschriebenes Website-Crawler Tool auf Spring zu portieren. Dabei kam es dann logischerweise zu einigen Fragen und Pitfalls, über die man als Spring-Neuling stolpert. In diesem Artikel will ich auf die Hürden bei der Entwicklung mit Spring […] The post Spring Framework für Azubis: Tutorial appeared first…

javatraining fachinformatikerattributebeandummies

13 Jul 2010

Schakko 1 min read

Für mein gegenwärtiges Freizeit-Projekt OpenRanked war es nötig, dass ich beim Starten der Applikation (Stand-Alone Anwendung ohne Anwendungsserver) ein Pfad zu einer .properties-Datei mit den Einstellungen des Servers übergeben konnte. Damit nun die übergebene .properties-Datei auch in der richtigen zeitlichen Reihenfolge geladen werden konnte, ist folgender Code-Schnipsel nötig: // _xmlFiles […] The post Spring: Properties für eine Applikation vor Starten…

javaanwendungapplicationcontextbeanfactory

16 Jun 2009

Federico 2 min read

Java has no goto statement, to break or continue multiple-nested loop or switch constructs, Java programmers place labels on loop and switch constructs, and then break out of or continue to the block named by the label. The following example shows how to use java break statement to terminate the labeled loop: public class BreakLabel […]

javaprogrammingpythonsoftware architecture

24 Jan 2009

Federico 1 min read

The Java platform will be celebrating its 14th birthday soon and one side-effect when a successful and ubiquitous language reaches this kind of milestone is the widespread proliferation of libraries, tools and ideas. In this article, Ted Neward tacks through the vast tides and presents a list of the key resources any up-and-coming Java developer […]

javaprogramming

4 Jan 2009

Federico 2 min read

Jetty Web server can be invoked and installed as a stand alone application server. It has a flexible component based architecture that allows it to be easily deployed and integrated in a diverse range of instances. The project is supported by a growing community and a team with a history of being responsive to innovations […]

javalinuxweb development