Note This sample has been tested with JBoss Application Server version 3.2.3. The sample might not work with later versions.
This sample shows how to compile, deploy, and run a solidDB J2EE sample application for a JBoss application server.
The files for the sample are located in the soliddb-installdir\samples\jboss directory. For general information about running the samples, see Samples.
Note The sample contains precompiled Java classes. If you want to build the Java classes from the source, you must install JDK 1.7 or later and set the PATH and CLASSPATH settings for the Java compiler.
The sample includes the following files:
▪ source\*.*: the source files for the Java classes
▪ build\*.*: the precompiled Java classes
▪ lib\*.*: the JAR files ready for deployment
▪ solid-ds.xml: the solidDB datasource deployment file, preconfigured with default database connection string, user name, and password
▪ deploy.bat: script that deploys the precompiled SolidTestEJB.jar into the JBoss server
▪ runclient.bat: script that runs the client part of the sample
▪ undeploy.bat: script that removes the JAR file from the JBoss deployment directory
▪ build.bat: script that builds the Java classes from the source and creates the JAR files
▪ clean.bat: script that deletes any build classes and JAR files
The sample assumes that you already have a solidDB server defined.
Running the sample
Complete the following steps to prepare your environment and run the sample:
1 Define two environment variables JBOSS_HOME and JBOSS_DEPLOYDIR by running the following commands:
set JBOSS_HOME=JBoss-root-directory set JBOSS_DEPLOYDIR=JBoss-deploy-directory
2 Copy the solidDB datasource deployment file (solid-ds.xml) to the JBoss deploy directory, and edit the file so it has the user name, password and connect string for your solidDB database server.
3 Start the solidDB server.
4 Start the JBoss server.
5 Add the solidDB JDBC driver jar file (SolidDriver2.0.jar) to the CLASSPATH environment variable of your command prompt by running the following command:
set CLASSPATH=%CLASSPATH%;full-path\SolidDriver2.0.jar
6 Add a path to a valid J2EE class library to the CLASSPATH environment variable, for example:
set CLASSPATH=%CLASSPATH%;%JBOSS_HOME%\server\all\lib\jboss-j2ee.jar
7 Deploy the precompiled solidDB JBoss sample file (lib\SolidTestEJB.jar) into the running JBoss server by running the deploy.bat script in the sample\JBoss directory. See JBoss server logs for messages about the progress of the sample deployment.
Note If you want to build the sample from the sources, run build.bat script first.
8 When the deployment is complete, run the client part of the sample application by running the script runclient.bat. The application fetches all table names from the solidDB server and prints them out to the console.