Jetty 6.0.1 with Apache Derby / JavaDB JDBCUserRealm

I finally got Jetty 6 JDBC Authentication Realms to work with Derby.

Problem was that Derby rejects the SQL produced by Jetty during the roles-for-user SQL request.
ERROR 42818: Comparisons between 'INTEGER' and 'CHAR' are not supported..
I have created a Jira entry for this. See

While I'm at it, setting up a JNDI DataSource in Jetty for Derby works as follows:

  <New id="mydatasource" class="">
     <New class="org.apache.derby.jdbc.ClientConnectionPoolDataSource">
      <Set name="DatabaseName">YourDatabaseName</Set>
      <Set name="ServerName">localhost</Set>
      <Set name="PortNumber">1527</Set>
      <Set name="User">username</Set>
      <Set name="Password">password</Set>
with access to it via
DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/DerbyDS");
as usual. ClientConnectionPoolDataSource is the DataSource driver that connects to a derby server via TCP/IP. Make sure to put this fragment in either WEB-INF/context.xml of your WebApp or one of the etc/yoursite.xml XML configuration files that you include in the jetty start command. Also make sure to include etc/jetty-plus.xml to get the JNDI stuff working.

Back to main page. Back to software page.

This page was last changed on November 15th, 2006. © Matthias Gärtner 2006