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
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
