Overload API methods with care

Overloading methods is a strong concept in API design, especially when your API is a fluent API or DSL (Domain Specific Language). This is the case for jOOQ, where you often want to use the exact same method name for various means of interaction with the library. Example: jOOQ Conditions package org.jooq; public interface Condition … Continue reading Overload API methods with care

Development schema, production schema

Most of us separate development data from production data, physically or at least, logically (except maybe Chuck Norris (official website, no kidding!)). If you're lucky and you can afford multiple Oracle / other-expensive-database licenses, you might clone the same schema / owner name for every application instance on different servers. But sometimes, you can't do … Continue reading Development schema, production schema

Use jOOQ inside your H2 database

I recently became aware of an interesting use-case for jOOQ when I was optimising my own H2 database integration tests: H2 stored functions H2 knows two operation modes for stored functions: "Inline mode" with source code provided "Reference mode" referencing a public static method of a Java class on the databases' classpath The above terms … Continue reading Use jOOQ inside your H2 database

What feature are you missing most in jOOQ?

This is your chance to influence future developments!

The comprehensive SQL bitwise operations compatibility list

One of the rather nasty, off-the-beaten-track battlefields in SQL non-standards are bitwise operations. To my knowledge, they're not in any SQL standard (I've checked SQL:2008 drafts), but almost all databases support some form of bitwise operations. Here's the relevant MySQL documentation page, as an example: https://dev.mysql.com/doc/refman/5.5/en/bit-functions.html So we're talking about these operations: bit_count(), and (&), … Continue reading The comprehensive SQL bitwise operations compatibility list

Derby casting madness – the sequel

I have recently blogged about the general bind variable casting madness in SQL: https://blog.jooq.org/rdbms-bind-variable-casting-madness/ So this is the sequel of the above story, purely dedicated to Derby with its "conversion table from hell". One of jOOQ's goals is to make SQL as compatible as possible across various databases, in a way that you can re-use … Continue reading Derby casting madness – the sequel

JDBC batch operations with jOOQ

So this was requested again, by another jOOQ user - support for an ancient JDBC feature - java.sql.Statement.addBatch(); With JDBC, you can easily execute several statements at once using the addBatch() method. Essentially, there are two modes in JDBC Execute several queries without bind values Execute one query several times with bind values With code, … Continue reading JDBC batch operations with jOOQ

Use jOOQ to transform java.sql.ResultSet

jOOQ has many uses. The fact that it provides a thin layer of additional abstraction over JDBC can be interesting enough for some users wanting to operate on their own java.sql.ResultSet objects. Let's say, you prefer using JDBC directly, for query execution, rather than letting jOOQ execute queries for you: PreparedStatement stmt = connection.prepareStatement(sql); ResultSet … Continue reading Use jOOQ to transform java.sql.ResultSet

Debug logging SQL with jOOQ

This nice little feature is not much advertised in the jOOQ manual, but probably it's something that most of us developers want and love when we have it. When you put log4j or slf4j on the classpath along with jOOQ, then jOOQ will use those frameworks for logging according to your configuration. While jOOQ is … Continue reading Debug logging SQL with jOOQ

Cloud Fever now also at Sybase

After SQL Server (SQL Azure) and MySQL (Google Cloud SQL), there is now also a SQL Anywhere database available in the cloud: http://www.sybase.ch/fujibeta It's called Sybase SQL Anywhere OnDemand or code name Fuji. I guess the connotation is that your data might as well be relocated to Fuji. Or your DBA might as well work … Continue reading Cloud Fever now also at Sybase