Derby, the database Java was missing



Derby looks very nice, and certainly much nicer now that we have an Open Source network (i.e. client/server and non-embedded) JDBC driver as opposed to when IBM open sourced Cloudspace. Of course, I wouldn’t expect to see sky-rocketing performance just yet (although I’m just wild-guessing and will wait for Derby-powered SPECjAppServer results to be proven wrong). The documentation that comes with the 10.1.1 version certainly looks very nice.

Roumen has already put together a small post on how to do a Derby hello world from NetBeans. To take this just a little step further, you can have Derby databases appear in the “Runtime” node of NetBeans 4.1 by doing the following simple steps:

– Add the network JDBC driver for Derby. Right-click on Databases->Drivers (Runtime tab), and select “Add JDBC Driver”. Add the derbyclient.jar file (from the lib Derby distrib directory), enter org.apache.derby.jdbc.ClientDriver as the driver class name (optionally click on “Find” to make sure it’s present in the JAR file) and give this driver configuration a name.

– Right-click on the newly created JDBC driver node and select “Connect Using…”. Enter a Database JDBC URL such as jdbc:derby://host:port/"databaseName;URLAttributes" (connections attribute details are found here). Default username and password is “app”.

– Once the connection is available in NetBeans, you can Drill down to lookup table structures and data, indexes, views, etc… You can also execute any SQL command, create new columns and new tables, and even obtain database schema (for off-line use)

More information on NetBeans out-of-the-box support for JDBC databases can be found here, and I guess Tor is suggesting that using Derby from Creator should be easy in the future…

If you haven’t already read this article, do so to get an idea of Sun’s involvement with Derby (Sun’s new Open Source application server Glassfish already uses Derby). Nice to see Sun leveraging someone else’s work for a change… ;-)

Author: alexismp

Google Developer Relations in Paris.

%d bloggers like this: