alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

HSQLDB example source code file (databaseinjar.txt)

This example HSQLDB source code file (databaseinjar.txt) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - HSQLDB tags/keywords

a, access, brendan, brendan, i, jar, jar, jnlp, jws, ryan, ryan, the, the, utf-8

The HSQLDB databaseinjar.txt source code

<?xml version="1.0" encoding="UTF-8"?>
<!--

A patch for storing a readonly hsqldb database in a Jar was contributed by Brendan Ryan
and has been incorporated into the code base. Additional work on connection URL
allow more uniform access to this feature.

The steps required are as follows:

Ensure the database does not contain CACHED or TEXT tables.
Make the database radonly after a SHUTDOWN.
Include the two database files *.properties and *.script in a directory in your Jar
Access the database with the jdbc:hsqldb:res: protocol

The relative location of the database as taken from the jdbc url is used.
For example, if the url is specified as "jdbc:hsqldb:res:/testdata/felder"
then the database is loaded from the "/testdata/" directory in the jar
and the database file names are "felder.properties" and
felder.script" in that directory.

Brendan Ryan wrote (text and sample changed):

I have made a small change to allow a readonly hsqldb database (.script and
.properties) to be stored in a JAR file so that it can be used with JWS.

A sample jnlp file is given below.

I hope the code is useful for someone.

Regards
Brendan Ryan
-->

<jnlp spec="1.0+" codebase="file:///c:/ERM/internet/build/pass/">
<information>
  <title>Mask Builder
  <vendor>PUI
  <homepage href="http://www.pi-ag.com" />
  <description>Demonstration of JNLP
  <icon href="raptor.gif"/>
</information>
<offline-allowed/>
<security>
  <all-permissions/>
</security>
<resources>
  <j2se version="1.4+" />
  <jar href="pass-maskbuilder.jar"/>
  <jar href="jaxb-rt-1.0-ea.jar"/>
  <jar href="hsqldb.jar"/>
  <jar href="testdb.jar"/>
  <property name="jdbc.drivers" value="org.hsqldb.jdbcDriver"/>
  <property name="jdbc.url" value="jdbc:hsqldb:res:/testdata/felder"/>
  <property name="jdbc.user" value="sa"/>
  <property name="jdbc.password" value="" />
</resources>
<application-desc />
</jnlp>

Other HSQLDB examples (source code examples)

Here is a short list of links related to this HSQLDB databaseinjar.txt source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.