Tuesday Sep 22, 2009

Videos to get acquainted with Apache Derby and Java DB



Kristian Wagaan and Richard Hillegas, both Apache Derby committers who also work on Java DB, recently gave some great presentations about Apache Derby and Java DB.

Kristian Wagaan presented at the 2009 OpenSQLCamp, in conjunction with FrOSCon 2009 in Europe.

The presentation (slides) gives a brief overview of Apache Derby, its history and the community around it. Further, it goes into the details of features that have been added in the latest releases and show how they enable powerful ways to use a relational database.

Rick Hillegas gave an introduction of Java DB / Apache Derby at The San Francisco Java User Group's Sep 8th event in San Francisco.

Wednesday Aug 26, 2009

Apache Derby 10.5.3 Bug-Fix Release is now available!

The Apache Derby project is pleased to announce a new bug-fix release of Derby,

Apache Derby is a subproject of the Apache DB project. Derby is a pure Java relational database engine which conforms to the ISO/ANSI SQL and JDBC standards. Derby aims to be easy for developers and customers to use.

Derby can be obtained from the Apache download site:

Derby contains many bug fixes plus localizations for messages added in the previous feature release, replaces, which introduced a query-ordering regression.

Here is the list of bug fixes addressed in 10.5.3.

Friday May 29, 2009

Java DB 10.5.1 now available

The Java DB project is pleased to announce a new feature release of Java DB 10.5.1.

Java DB is Sun's branded distribution of the Apache Derby open source  database. Java DB is a pure Java relational database engine which conforms to the ISO/ANSI SQL and JDBC standards. Java DB aims to be easy for developers and end-users to work with.

Java DB 10.5.1 can be obtained from the Java DB download site:

Java DB 10.5.1 introduces the following new features and improvements:

  • In-memory databases for test rigs and transient data
  • Replication of Encrypted Data for failover of sensitive databases
  • OFFSET/FETCH FIRST for paging through query results efficiently
  • SQL Roles for administering fine-grained access controls
  • Generated Columns for speeding up queries by pre-computing results
  • LOB Improvements for speeding up access to large binary and text objects
  • Optimizer Statistics Improvements for better management of query plans

Java DB offers the following: 

  • Installers for various platforms
  • Support offering (more info)
  • Notification of new releases and updates via registration
  • Native Netbeans integration
  • Bundled in GlassFish and Sun JDK6
If you are interested in learning more or/and sharing feedback about Java DB, please come and visit us at our POD during CommunityOne and JavaOne 2009.

Sunday Nov 09, 2008

Java DB and GlassFish v3 Prelude

GlassFish v3 Prelude launched recently and bundles Java DB, Sun's supported version of Apache Derby.

As you may already know, GlassFish v3's foundations are based on HK2, some Hundred Kilobytes Kernel with a module subsystem and component model that can run on top of OSGI.

Java DB modular architecture is similarly based on modules and services components and can also run as an OSGI bundle. Both GlassFish and Java DB can run embedded in some Java framework or as standalone applications in their own JVM process.

I thought I would highlight how you can get Java DB running in one command and start using it. Note that there is no change as far as how Java DB is run with previous versions of GlassFish.

To start a GlassFish server instance:
\*\* Hint: First make sure to set JAVA_HOME environment variable to point to Sun JDK6 root installation directory.
> cd glassfishv3-prelude (or wherever directory you have installed GlassFish)
> bin\\asadmin start-domain (to start the default domain instance)

Then all you have to do to start Java DB as a standalone server process is:
> bin\\asadmin start-database

Database started in Network Server mode on host and port 1527.
--------- Derby Network Server Information --------
Version: CSS10020/ - (538595)  Build: 538595  DRDA Product Id: CSS10020
-- listing properties --

Now, that GlassFish and Java DB have been started, you can test a ping connection via the GlassFish Administration console at:

Navigate to Resources> JDBC> Connection Pools> DerbyPool
which is a pre-defined sample JDBC connection pool.

You will be able to ping the running Java DB instance by clicking on the Ping button.

It will create some sun-appserv-samples GlassFish sample database by default under glassfishv3-prelude\\glassfish\\databases directory and derby.log will also be under that same location.

That's it. You can now access the sample database via the JDBC sample DerbyPool connection pool from your application.

You could also connect via IJ, Java DB's command-line tool as follows:
> set DERBY_INSTALL=C:\\glassfishv3-prelude\\javadb
> cd glassfishv3-prelude
> javadb\\frameworks\\NetworkServer\\bin\\ij
> ij version 10.2
   ij> connect 'jdbc:derby://localhost:1527/sun-appserv-samples;user=APP;password=APP';
   ij> select count(\*) COUNT from sys.systables;
   ij> exit;

To stop Java DB, simply run:
> bin\\asadmin stop-database
Connection obtained for host:, port number 1527.
Apache Derby Network Server - - (538595) shutdown at 2008-11-09 08:48:43.312 GMT
Command stop-database executed successfully.

More information about GlassFish's admin start-database and stop-database commands.

Wednesday Oct 22, 2008

Java DB / Apache Derby Table Functions White Paper

Rick Hillegas has posted a great white paper on Java DB / Apache Derby support of ANSI SQL 2003 Table Functions.

A table function is like a virtual table that allows you to access data externally as if it was a local table, via the full, expressive power of SQL.

Data returned by these special functions can come from anywhere:

  1. files - files and web resources
  2. collections - in-memory collections
  3. foreign data - other databases, including non-relational sources
  4. streams - transient information streams, including data feeds and device outputs

Table functions are easy to implement and Rick's white-paper has several examples of practical table function use cases.

Derby has itself several implementations of virtual tables that can be accessed directly. One that you might already know is LOCK_TABLE that shows all locks currently held in the database.
TRANSACTION_TABLE, STATEMENT_CACHE and SPACE_TABLE amongst others are additional ones that can be quite useful.

Documentation about Java DB / Derby table functions can also be found here.

Wednesday Jul 30, 2008

SNCF rides on GlassFish and Java DB

As Alexis Moussine-Pouchkine posted on this blog, the French railways company, SNCF uses GlassFish and Java DB (based on Apache Derby) to power a monitoring application which produces alerts with a real-time graphical representation of key system variables as well as PDF reports.

Don't miss this questionnaire with Franck LeprĂȘtre, Software Architect at SNCF.

Java DB version is bundled in Glassfish V2.

Tuesday Mar 06, 2007

Migrating Your Application to Use Java DB

In this article, a web application that was developed using the Pointbase database is migrated to use Java DB. The web application was originally developed in the NetBeans 4.1 integrated development environment (IDE).

Java DB is Sun Microsystem's supported distribution of the Apache Derby 100% Java database. IF you are using JDK 6, Java DB is included as part of this last one. You can also download the Sun Java System Application Server, which includes Java DB.

When registering the application server in NetBeans 5.5, Java DB will be automatically registered as well. Alternatively, you can download the Java EE 5 Tools Bundle, which includes both the NetBeans IDE and Sun Java System Application Server.. Java DB is fully transactional, secure, and compliant with the JDBC, SQL, and J2EE standards.




« March 2017