![]() | ![]() | contents |
Now you are ready to build your application. The process for building VoltDB applications is as follows:
Compile the Java source files for the client application and stored procedures
Compile the database schema and stored procedures into an application catalog
Compiling Java source files involve dependencies on several VoltDB modules. The easiest way to build a VoltDB
application is to use a build procedure such as Ant, make, or a shell script to automate the process. A shell script,
run.sh, is included with the Hello World source files online for those who want to use it. However,
to familiarize you with all the components, this section describes the individual commands that are used to build a VoltDB
application.
To compile the Java source files, you must first make sure your Java classpath includes your working directory as well as the VoltDB Jar files created when you installed VoltDB. For the purposes of this example, we assume VoltDB is installed in your account's home directory as $HOME/voltdb. To specify a classpath that includes both your helloworld directory and the VoltDB jar files, define the environment variable CLASSPATH, as in the following example. If you are no longer in your working directory, you will want to set default to that directory now as well:
$ cd $HOME/helloworld $ CLASSPATH="./:/opt/voltdb/lib/*:/opt/voltdb/voltdb/*" $ export CLASSPATH
Now compile the client application and stored procedure source files using the javac command:
$ javac Client.java $ javac Insert.java $ javac Select.java
Finally, you must recompile the application catalog to include the new stored procedures and partitioning information you added to the schema. The voltdb compile command will use your classpath to look for the stored procedure class files. Or you can add to the classpath using the --classpath flag on the command line. For completeness we will include your current working directory on the command line. If you compiled the stored procedures to an alternate directory, you would include that directory in your classpath here. The command to recompile your catalog is as follows:
$ voltdb compile --classpath="./" \
-o helloworld.jar helloworld.sql
The Tao of VoltDB
The 5 Principles of VoltDB
VoltDB Technosphere
Products and Solutions
Technical Support
Key Features
Download VoltDB
No Limits
VoltDB Application Gallery
Infinite Possibilities
VoltBuilder Program
