solidDB Help : Samples : J2EE sample for Oracle WebLogic Server
  
J2EE sample for Oracle WebLogic Server
Note This sample has been tested with Oracle WebLogic Server versions 10.3 and 8.1. The sample might not work with later versions.
This sample demonstrates how to compile, deploy and run a J2EE sample application for a WebLogic application server.
The files for the sample are located in the soliddb-installdir\samples\weblogic 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 WebLogic server
runclient.bat: script that runs the client part of the sample
undeploy.bat: script that removes the JAR file from the WebLogic 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 Find the script file startWebLogic.cmd in your WebLogic server domain directory and edit the file to add the full path of the solidDB JDBC driver file (SolidDriver2.0.jar) to the CLASSPATH definition.
2 Start the WebLogic server by running the startWebLogic.cmd script. As the server starts, you can verify that the correct path to SolidDriver2.0.jar is in the CLASSPATH by looking at the output.
3 Start the solidDB server.
4 Connect to the WebLogic server by using the WebLogic Server Console, and complete the following steps:
a Create a new connection pool:
Name: solidDB JDBC Connection Pool (for example)
URL: jdbc:solid://localhost:port (where port is a valid listening address)
Driver Classname: solid.jdbc.SolidDriver
Username: DBA (for example)
Password: DBA (for example)
b Create a new JDBC Data Source:
Name: solidDB Data Source (for example)
JNDI name: SolidDataSource
Pool Name: connection-pool-name (as configured in previous step)
Deselect the Honor global transactions checkbox.
5 Set up the environment variables for deployment by running the WebLogic setEnv.cmd script in your WebLogic server domain directory.
6 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
7 Define two environment variables WL_USER and WL_PWD to contain the user name and password of your WebLogic server administrator by running the following commands.
set WL_USER=admin-name
set WL_PWD=admin-password
Note These variables are used by the deploy.bat and undeploy.bat script files.
8 Deploy the precompiled solidDB WebLogic sample file (lib\SolidTestEJB.jar) into the running WebLogic server by running the deploy.bat script in the sample\Weblogic directory. See WebLogic 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.
9 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.
Go up to
Samples