solidDB Help : Samples : Linked Library Access with Java and diskless server sample
Linked Library Access with Java and diskless server sample
This sample Java application demonstrates how to use the solidDB Linked Library Access (LLA) with Java to create a diskless solidDB server. For more information about using diskless servers, see Using the diskless capability with SMA and LLA servers.
The files for the sample are located in the soliddb-installdir\samples\aclib_java_diskless directory.
Note To run this sample, the following conditions must be true:
– Your solidDB license file must have the solidDB LLA component enabled.
– You must install JDK 1.7 or later and set the PATH and CLASSPATH settings for the Java compiler.
For general information about running the samples, see Samples.
Note LLA was previously known as Accelerator.
The sample includes two Java applications:
▪ LicPrep.java: an application that converts the solidDB license file (solideval.lic) to a text string that is used when the diskless server is started.
▪ SJADLSample.java: a solidDB Java application that shows how to use the solidDB LLA server with the solidDB JDBC API. The sample is written in Java and uses JDBC API calls to complete the following actions:
– Start the LLA server by using the proprietary SSC API for Java class SolidServerControl method 'startDisklessServer'.
The listen name is specified in the solid.ini string. The sample uses 'dba' as the default catalog_name, username, and password.
– Create a table in the database.
– Create two user threads and register them with the server by calling the SolidServerControl API method 'registerThread'. The user threads insert a random amount of data inside the table.
– Unregister the user threads by calling the SolidServerControl API 'unregisterThread' method. The main thread waits until the user threads exit and outputs the data that is in the table.
– Drop the table.
– Stop the LLA server by calling ‘stopServer’.
Running the sample
You can run the runme script (runme.bat in Windows), which both compiles and runs the applications.
If you check the sample directory during and after the time that the application runs, you will see that there is no solidDB database file in the disk directory. The server truly is running as a diskless server.