Skip to content
Well ... Jdbc can be nice !
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

JDBC can be nice

This 'toy' library is not intended for large scale projects, but rather for quick hacking with jdbc, making it less painful and more pleasant to use.


You need a Java 5 (or newer) environment and Maven 2.0.9 (or newer) installed:

$ mvn --version
Apache Maven 3.0-alpha-5 (r883378; 2009-11-23 16:53:41+0100)
Java version: 1.6.0_15
Java home: /usr/lib/jvm/java-6-sun-
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.31-12-generic" arch: "i386" Family: "unix"

You should now be able to do a full build of jdbc-can-be-nice:

$ git clone git://
$ cd jdbc-can-be-nice
$ mvn clean install

To use this library in your projects, add the following to the dependencies section of your pom.xml:


If you don't use Maven, take jdbc-can-be-nice-0.9-SNAPSHOT.jar and all of its dependencies, and add them to your classpath.


Please consider using Github issues tracker to submit bug reports or feature requests.

Using this library

Here is a sample showing the usage of many features of this library, like transactions, chaining, querying and generated keys retrieval :

ConnectionProvider connectionProvider = cachingConnectionProvider(driverManagerConnectionProvider(
	"jdbc:derby:crud;create=true", "", ""));
Number key = doWithConnection(
			sqlUpdate("delete * from table").then(
					sqlUpdate("insert into table values(?, ?)",
							true, "a"))).thenReturn(
					"insert into table2 values(?)", 8), -1)),
RowMapper<String> namesMapper = new RowMapper<String>() {

public String mapRow(ResultSet resultSet, int row)
		throws SQLException {
	return resultSet.getString("name");

List<String> names = doWithConnection(sqlQuery(
	"select name from table where age < ?", namesMapper, 20),


See LICENSE for details.

You can’t perform that action at this time.