Using JavaDB from Processing

Nikolaus Gradwohl2011-04-27T05:01:35+00:00

JDBC is the java api for connecting to sql databases. Since java6, javadb - a small, simple, javabased database-engine is delivered with java. This is a small example of how to access a database with javaDB from a processing-sketch.

First you need to download the driver from the javadb download site select the "All Plattforms" package and extract derby.jar from the zip file.

Add this jar file to your processing-sketch using the "Add File..."-Item form the "Sketch"-Menu.

The following sketch creates a small database containing one table in the setup method (the "drop table ..." statement deletes the table if it already exists. If you want to pregenerate your database or keep it, remove this line.)

read more ...