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

Liquibase for DB Migrations

I have just now discovered a very nice-looking tool for database migrations: Liquibase https://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

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

What are procedures and functions after all?

Many RDBMS support the concept of "routines", usually calling them procedures and/or functions. These concepts have been around in programming languages for a while, also outside of databases. Famous languages distinguishing procedures from functions are: Ada BASIC Pascal etc... The general distinction between (stored) procedures and (stored) functions can be summarised like this: Procedures: Are … Continue reading What are procedures and functions after all?

SQL Trouble with dummy tables

As I'm mostly using Oracle for work projects, the concept of the DUAL dummy table has become quite intuitive. I hardly ever think about the days when I was playing around with that table to find out its purpose (e.g. writing into it when DUAL was still a physical object, and thus killing the whole … Continue reading SQL Trouble with dummy tables

Google Cloud SQL, the next step for jOOQ?

"The Cloud" is probably the biggest IT buzzword in 2011. It may as well be as meaningless and as short-lived as its predecessors "web 2.0" and "dotcom", but clearly, the big companies are aiming for "The Cloud" right now. After Microsoft's all-out marketing campaign for Windows Azure and its sub-product SQL Azure, there is now … Continue reading Google Cloud SQL, the next step for jOOQ?

Recursive queries with Oracle’s CONNECT BY clause

Recursive or hierarchical queries are an awkward thing in SQL. Some RDBMS allow for recursiveness in Common Table Expressions (CTE's), but those queries tend to be quite unreadable. That's not the case for Oracle, which, in addition to recursive CTE's also supports a dedicated CONNECT BY clause. The general syntax for this clause looks something … Continue reading Recursive queries with Oracle’s CONNECT BY clause