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

Java’s Arrays.asList(…) is underused

Writing nice and concise code is feasible in Java as well, not only in those hyped, new, and fancy scripting languages. Here are some examples on how to use the Java 5 varargs Arrays.asList() method in nice contexts: Run a block for n constant values // If you have VAL_A, VAL_B, VAL_C and you want … Continue reading Java’s Arrays.asList(…) is underused

jOOQ in the wild

The first open source projects start to appear on the web with public dependencies on jOOQ. One of them is a small backup tool called blizzys-backup by Maik Schreiber. It uses jOOQ to handle a small H2 database with 3-4 relations describing scheduled backups and backup-file meta data. Interestingly, Maik seems to prefer lazy fetching … Continue reading jOOQ in the wild

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

Annotatiomania™, next level. JPA and JAXB combined

This is a very nice specimen of annotatiomania in the wild. When people not only confuse OO with relational, but also with XML. The "OOXMLational" model class, so to speak. Check this out: @Entity @Table(name = "Person", catalog = "TestDB", schema = "dbo") @XmlRootElement @NamedQueries({ @NamedQuery( name = "Person.findAll", query = "SELECT p FROM Person … Continue reading Annotatiomania™, next level. JPA and JAXB combined

Liquibase for DB Migrations

I have just now discovered a very nice-looking tool for database migrations: Liquibase http://www.liquibase.org/ With Liquibase, you can model your DB increments as XML files that will translate to as many as 13 different databases. A sample DB increment (taken from the Liquibase manual): property='vat' ...and so on. I guess it's about time to contact … Continue reading Liquibase for DB Migrations

jOOQ and Google Cloud SQL Example

This is all too simple. Here's how you can create an easy jOOQ / Google Cloud SQL integration example: Sign up with Google App Engine Sign up with Google Cloud SQL Create a Google App Engine project (preferably with Eclipse) Add jOOQ to your project Add your generated schema to your project Done Google Cloud … Continue reading jOOQ and Google Cloud SQL Example

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