When you work with JAXB to generate Java code from XSD (or *ghasp* WSDL) files, you're going to use the XJC tool, which is shipped with the JDK (at least until JDK 9 - with Jigsaw, it will soon be externalised into its own external dependency). Adding plugins to XJC when running it via Maven … Continue reading How to Implement Your Own XJC Plugin to Generate toString(), equals(), and hashCode() Methods
Calculating Tupper’s Self-Referential Formula With SQL
A really geeky way to start a Monday morning is to be nerd-sniped by the cool Fermat's Library twitter account... https://twitter.com/fermatslibrary/status/960154478224793600 ... reading up on the cool Tupper's Self-Referential Formula thinking "Can This be Done in SQL?™" As we all know from a previous article, SQL is turing complete, so the answer must be yes. … Continue reading Calculating Tupper’s Self-Referential Formula With SQL
Top 5 Hidden jOOQ Features
jOOQ's main value proposition is obvious: Type safe embedded SQL in Java. People who actively look for such a SQL builder will inevitably stumble upon jOOQ and love it, of course. But a lot of people don't really need a SQL builder - yet, jOOQ can still be immensely helpful in other situations, through its … Continue reading Top 5 Hidden jOOQ Features
Do not GRANT ALL PRIVILEGES to your Production Users
Thanks to the generous contributions of Timur Shaidullin, jOOQ 3.11 will now support GRANT and REVOKE statements through #6812. While implementing integration tests for these new features, I had researched the different ways how these statements work on a variety of databases, and the good news is, they're all mostly quite standardised (in fact, they're … Continue reading Do not GRANT ALL PRIVILEGES to your Production Users
Creating a Microsoft Excel Style Pivot Table With Grand Totals in SQL
This answer to a beautiful Stack Overflow question I've given recently needs further explanation in a blog post. When working with Microsoft Excel, we can create beautiful and also very insightful Pivot Tables with grand totals. What are they? This is best explained visually. Assuming you have this normalised form for your raw data. As … Continue reading Creating a Microsoft Excel Style Pivot Table With Grand Totals in SQL
The Cost of JDBC Server Roundtrips
Or: Move That Loop into the Server Already! This article will illustrate the significance of something that I always thought to be common sense, but I keep seeing people getting this (very) wrong in their productive systems. Chances are, in fact, that most applications out there suffer from this performance problem - and the fix … Continue reading The Cost of JDBC Server Roundtrips
How to Fetch Oracle DBMS_OUTPUT from JDBC
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: CREATE TABLE my_table (i INT); CREATE OR REPLACE PROCEDURE my_procedure (i1 INT, i2 INT) IS BEGIN INSERT INTO my_table SELECT i1 FROM dual UNION ALL SELECT i2 … Continue reading How to Fetch Oracle DBMS_OUTPUT from JDBC
A Common Mistake Developers Make When Caching Nullable Values
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 Mistake Developers Make When Caching Nullable Values
How to Ensure Your Code Works With Older JDKs
jOOQ is a very backwards compatible product. This doesn't only mean that we keep our own API backwards compatible as well as possible, but we also still support Java 6 in our commercial distributions. In a previous blog post, I've shown how we manage to support Java 6 while at the same time not missing … Continue reading How to Ensure Your Code Works With Older JDKs
Using JDK 10’s Local Variable Type Inference with jOOQ
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 10’s Local Variable Type Inference with jOOQ
