Apache Derby Applets

You can create a Java applet that includes access to an Apache Derby database. To make this work, the applet must use a network driver to connect to the database. In addition, Apache Derby needs to be started as a network database.

The following example is an applet that retrieves the title and the start and end dates of all the productions running at the YMLD Theater:

 01 public class DERBYAPPLT extends Applet { 02 Connection conn = null; 03 public void init() { try { 04 String url = "jdbc:derby:net://localhost/YMLD:user=APP;password=APP;"; 05 Class.forName("com.ibm.db2.jcc.DB2Driver"); conn = DriverManager.getConnection(url); } catch(Exception e) { e.printStackTrace(); } } public void paint(Graphics g) { try { Font font ...

Get Apache Derby—Off to the Races: Includes Details of IBM® Cloudscape™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.