Installations

Installations

Configuration

How to build the demonstration application DemoContact

How to create the database DemoContact

How to build the application DemoContact

How to generate the default XML source for your database

 

 Installations

  1. Install the Sun J2SDK 1.4 (Java 2 Standard Development Kit). You can find it in java.sun.com.
  2. Unzip the MelbaLab (download here)
  3. If you want to deploy a client-servlet-database architecture, install a servlet engine. Tomcat from Apache for example.
  4. Install a supported DBMS with its JDBC or ODBC driver.

Remark: it is possible to use the J2SDK 1.3.1, but you need a JAXP library, such as crimson from Apache.

 

 Configuration

Under Windows: Edit and modify the file <melbalab-home>/melbabuild.bat:

  • Define the path to the directory <java-home>/bin/.
  • If you want to deploy a client-servlet-database architecture, define the path for the Java package javax.servlet too.

Under Linux: ditto with the file <melbalab-home>/melbabuild. You have to make it runnable too (with command 'chmod').

 

 How to build the demonstration application DemoContact

To check that your installation is correct, I suggest that you build the DemoContact application. You can find source files in <melbalab-home>/samples/. This application needs the database DemoContact. Below, you can find the operations for MySQL. If you have an other DBMS, you'll find an SQL script to create the tables at the end of the file <melbalab-home>/samples/democontact_en.xml.

How to create the database DemoContact

  1. Under Windows, you need to launch manually the MySQL server. In a shell (DOS box), go to the directory <mysql-home>/bin/, then execute:
       mysqld -b=<mysql-home> --language=<mysql-home>\share\english --datadir=<mysql-home>\data
  2. Launch the MySQL shell with the command: <mysql-home>/bin/mysql
  3. To create the database:
       create database DemoContact;
  4. To work on DemoContact:
       use DemoContact;
  5. Copy/paste from the end of the file <melbalab-home>/samples/democontact_en.xml to the MySQL shell. Under Windows Nt / 2000, you can paste the text by clicking on the icon at the top left corner of the DOS window.
  6. To quit: exit . Your database is created.

How to build the application DemoContact

  1. Check that the file <melbalab-home>/samples/democontact_en.xml is in the directory <melbalab-home>/src_xml/
  2. Open a shell / a DOS box
  3. Go to the directory <melbalab-home>/ (command 'cd')
  4. Execute: melbabuild democontact_en
  5. The result of this command is a file: democontact_en.jar in the directory <melbalab-home>/result/
  6. Execute the file democontact_en.jar by double-clicking or with the command: java -jar result/democontact_en.jar .

Now you can read the Sashipa tutorial, which uses the DemoContact application as an example.

 

 How to generate the default XML source for your database

We will see here how to generate the default source to make an interface for your database. The Database2Sashipa software creates it for you, from a database connection and default hypotheses. So an existing database is required.

The graphical user interface for this software is currently in development. So below you can find the operations for the command prompt version:

  • Open a shell / a DOS box
  • Go to the directory <melbalab-home>/ (command 'cd')
  • Check that your JDBC driver is supported by Database2Sashipa (compatibilities), then try the command:

 java -cp "melbakit.jar:the_path_to_the_jdbc_driver.jar" databasesashipa.Database2Sashipa 

Under Windows, the colon (the character ':') that separates "melbakit.jar" and "the_path_to_the_jdbc_driver.jar" has to be replaced by a semi-colon (the character ';') ...

This command displays the available connection options. Relaunch it with the correct connection information for your DBMS. For example, with DemoContact under PostGreSQL:

 java -cp "melbakit.jar:/usr/local/javalib/postgresql/pg73b1jdbc3.jar" databasesashipa.Database2Sashipa -s postgresql -db DemoContact -u chocolat -p "70%" -cn "//localhost/DemoContact" -f "src_xml/democontact_auto.xml" -l en 

  • The output is a file: democontact_auto.xml in the directory <melbalab-home>/src_xml/

At this point, you can build your software with the command: melbabuild democontact_auto .