Friday, February 20, 2009

Adding Derby DB support to Apache Tomcat

I'm creating a web application that is really just made up of JSPs, servlets, html, Javascript, and a Derby database. I'd like to use Apache Tomcat, because it integrates with Netbeans, and is lighter weight than a full-blown EE server. But Tomcat doesn't ship with Derby.

I'm not all that familiar with Tomcat (yet), so what's the quickest way to get Derby into Tomcat? It wasn't too hard to figure this out with some searching.

It turns out that the 'lib' directory in Tomcat's installation directory is in the class path by default. So, you only need to copy the Derby jar files,  derby.jar and derbyclient.jar, to that directory.

Bash:
cp $DERBY_HOME/derby{,client}.jar  $TOMCAT_INSTALL/lib

No comments: