From Eclipsepedia

Jump to: navigation, search


Running EclipseLink on the Derby Database

  • Running EclipseLink on derby has several advantages including ease of installation and small footprint for rapid development - and the fact that it is also open source like EclipseLink.
  • This tutorial is currently working with Derby

Retrofitting an existing Java SE application to use Derby


EE persistence.xml

SE persistence.xml

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="" xmlns:xsi="" xsi:schemaLocation="">
  <persistence-unit name="dao.create.tables.derby" transaction-type="RESOURCE_LOCAL">
      <property name="eclipselink.jdbc.driver" value="org.apache.derby.jdbc.ClientDriver"/>
      <property name="" value="Derby"/>            
      <property name="eclipselink.jdbc.url" value="jdbc:derby://localhost:1527/weblogic;create=true"/>
      <property name="eclipselink.jdbc.user" value="APP"/>
      <property name="eclipselink.jdbc.password" value="APP"/>
      <property name="eclipselink.logging.level" value="ALL"/>            
      <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
      <property name="eclipselink.ddl-generation.output-mode" value="database"/>

Add derby jars

  • SE: Add derby jars to the application classpath
  • EE: Add derby jars to the application server classpath (Example: for WebLogic place in the modules directory)


  • Originated 20091113 for Derby