Database Applet - Java

Home| Download| Support

Database Applet requires that java 1.3 or higher. The latest java can be downloaded from www.java.com. Database Applet is a java applet, a plugin, that runs inside a web page.

Setup Instructions

1. Locate the Database Applet install directory on your computer. On windows the default directory is c:\program files\dbapplet. If you downloaded the zip package the install directory is the location or the extracted files.
2. Create an empty folder for your project
3. Copy the dbapplet.jar file in the install directory to the new project folder. This file contains the applet
4. Prepare your data in a CSV (Comma delimited) format and save it to the project folder in a file named data.csv. Software like Microsoft Excel will allow you to "Save as" in CSV format The default name is data.csv. You can use another name and set the dataFile property in the properties file as described below.
5. Create a file named dbapplet.properties in the project folder. This file is a configuration file for the applet. The details on how to configure the applet are described below. Use a simple text editor to create dbapplet.properties. You can name the properties file something else and specify the properties file in the applet param tag as shown below
6. Create a html file that contains the applet tag below. You can cut and paste the tag below into your html file.

7. You should now have four files in the project folder you created, dbapplet.jar, dbapplet.properties, data.csv and your html file. Upload these files to your web site and open the html page in a web browser. You should see the applet and the data loading correctly. Before you test the applet you typically want to add a minimum of configuration instructions in the dbapplet.properties such as column names and data types. Add one property per line in dbapplet.properties. A property has a name and a value separated by a space. The properties are listed below. All properties are optional

Properties in the dbapplet.properties file

Property Description

headerInFile

If this is set to true the applet will use the first line in the data.csv file as column headers.

rowCount

Number of rows (lines) in your data file.

column

You can add a column property per column in the data file. The column property is followed by arguments such as name and type e.g. name=Price; type=number; pattern=$#,##0.00. The applet will use the name as column header and type to format and sort the column. In addtion to name and type arguments the column can have href and baseref arguments.

dataFile

data.cvs is the default data file. You can specify another name with the dataFile property.

delimiter

Comma is the default delimiter. You can specify other delimiters. The delimiter property be one of the following: COMMA, SPACE, TAB, POUND or SEMICOLON.

licenseKey

Your license key. Without a valid license key the applet will display a Nag Screen every time it loads.

printAction

Link to a server side script that will print the selected rows. E.g.


printAction http://www.nktsoft.com/php/upload.php

checkoutAction

Link to a server side script that will display a shopping chart containing the selected rows E.g.


checkoutAction http://www.nktsoft.com/php/checkout.php

 


Column type Description

text

Default type. Columns will sort as text

number

Decimal numbers. You can add a pattern or format. See the products demo on how to add a pattern to numbers. See the java api for valid number patterns

integer

Use for integral numbers (A whole number positive, negative or zero).

boolean

data that are either true or false.

date

Date values.

link

Data in link columns are displayed in blue. When the user clicks on link type the applet will try to construct a link and show the link in a browser window. If the link column itself contains a link e.g. http://www.mysite.com/mypage.html" no further instructions are needed. If the link data is in another column you can add a href=columnName that will point to another column with the link data. The href column will not be shown

 

Actions
The printAction and checkoutAction properties are powerful gateways that can be used to integrate Database Applet with other systems. It will allow Database Applet to be used as a front end for printing, reporting or shopping online. These actions must point to a server side script on the same host as Database Applet was loaded from (for security reasons). If the printAction and or checkoutAction is configured a corresponding print or check out button will appear in the tool bar. When the user clicks on the button Database Applet will upload the rows that are checked to the server side script in csv file format. The server side script must save the csv file in a session and write back one line of text that contains an URL that Database Applet will then load in the web browser. The upload.php and print.php scripts included in this download will demonstrate how this works for the printAction.

Demo 1

Proteins database

Demo 2

Minimal config

Demo 3

Link and mailto

Demo 5

Customers database

Demo 5

Products database