Database Deployment

For the database example there are the following additional sources:

We have used the following directory layout for the Java sources (Database.java and State-mentAPI.java) and the Prolog text (driver.p). We provide them together with the SQL scripts. We also reuse some artefacts from the previous terminal and standalone example, but we do not show them here:

example01
example02
example06
+--- Database.java
+--- driver.p
+--- insert.sql
+--- schema.sql
+--- StatementAPI.java

The example accesses an SQL database management system via JDBC. The JDBC connection expects a database inside the database management system. The provided SQL scripts can be used to create the schema (schema.sql) of this database and to populate the database (insert.sql) with table content:

The compilation is done similar as for the previous examples, and we do not show it here. There will be one directory layout for the resulting Java byte code. We use this directory layout for the client side, which is very similar to the one of the standalone Swing GUI application, so that we can run it from the IDE.

WEB-INF
+--- classes
+--- example01
+--- example02
+--- example06
+--- Database.class
+--- driver.p
+--- StatementAPI.class

We do not show the placement of the Jekejeke Prolog runtime library (interpreter.jar) into the class path, which is also required. A JDBC driver of the used SQL database management system needs to be put as well into the class path. The format and parameters of the JDBC connection URI in the code depends on these choices.

Kommentare