When speaking about business applications, you might find that a lot of them fall into the “data-centric” kind of application where SQL is frequently the key technology. Similarly, when speaking about web applications, you’ll end up with HTML rendered on the browser, most likely with the help of JavaScript. If we put this into the […]

Read more

There are some things in SQL that we simply take for granted without thinking about them properly. One of these things are the GROUP BY and the less popular HAVING clauses. Let’s look at a simple example. For this example, we’ll reiterate the example database we’ve seen in this previous article about the awesome LEAD(), […]

Read more

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 bar […]

Read more

Java does not provide an API to directly support the expressiveness and power of SQL. All attention is given to object-relational mapping and abstractions on a higher level, such as OQL, HQL, JPQL, CriteriaQuery. jOOQ is a dual-licensed open source product that fills this gap. It implements SQL itself as a type-safe, domain-specific language in […]

Read more

By Lukas Eder (originally posted at jooq.org) Oracle database has its ways. In my SQL talks at conferences, I love to confuse people with the following Oracle facts: … and the answer is, of course: Isn’t it horrible to make empty string the same thing as NULL? Please, Oracle… The only actually reasonable slide to follow […]

Read more

By Lukas Eder (originally posted at jooq.org) We’ve just added support for the EVERY() aggregate function (#1391) to jOOQ, and would like to take the opportunity of letting you know of this true SQL gem that can come in handy EVERY(now and then) (pun intended). Let’s assume we have four books in our table: 1 2 3 […]

Read more

By Lukas Eder (originally posted at jooq.org) How do you create a range from 1 to 10 in SQL? Have you ever thought about it? This is such an easy problem to solve in any imperative language, it’s ridiculous. Take Java (or C, whatever you like) for instance: This was easy, right? Things even look more […]

Read more

How jOOQ leverages generic type safety in its DSL Few Java developers are aware of this, but SQL is a very type safe language. In the Java ecosystem, if you’re using JDBC, you’re operating on dynamically constructed SQL strings, which are sent to the server for execution – or failure. Some IDEs may have started […]

Read more

Now that I have your attention, I’d like to invite you to a critical review of where we’re at in the MySQL vs. MariaDB debate. Earlier this year, I visited Oracle Open World 2014, and I met with Morgan Tocker, the MySQL community manager at Oracle to learn about where MySQL is heading. Who “is” […]

Read more

By Lukas Eder CHECK constraints are already pretty great when you want to sanitize your data. But there are some limitations to CHECK constraints, including the fact that they are applied to the table itself, when sometimes, you want to specify constraints that only apply in certain situations. This can be done with the SQL standard WITH CHECK OPTION clause, […]

Read more