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

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) The threat caused by SQL injection is heavily underestimated even by many senior developers and software architects. Most people are unaware of the fact that an entire server can be at risk by a single vulnerability even in the remotest piece of logic. This article will give a frightening […]

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

By Lukas Eder (originally posted at jooq.org) You can also hear more from Lukas in this ‘hanginar‘ with Arun Gupta, where he discusses what jOOQ brings to Java EE.  We’ve been in business for more than one year now with our dual-licensing strategy for jOOQ. While this strategy has worked very well for us, it has also been a bit […]

Read more