Chapter 5. Building Your VoltDB Application


VoltDB Home » Documentation » Using VoltDB

Chapter 5. Building Your VoltDB Application

Once you have designed your application and created the source files, you are ready to build your application. There are four steps to building a VoltDB application:

  1. Compiling the client application and stored procedures

  2. Declaring the stored procedures in the schema

  3. Compiling the VoltDB application catalog

This chapter explains these steps in more detail.

5.1. Compiling the Client Application and Stored Procedures

The VoltDB client application and stored procedures are written as Java classes[2], so you compile them using the Java compiler. To do this, you must include the VoltDB libraries in the classpath so Java can resolve references to the VoltDB classes and methods. It is possible to do this manually by defining the environment variable CLASSPATH or using the -classpath argument on the command line. You can also specify where to create the resulting class files using the -o flag to specify an output directory, as in the following example:

$ javac -classpath "./:/opt/voltdb/voltdb/*" \
        -o ./obj  \

The preceding example assumes that the VoltDB software has been installed in the folder /opt/voltdb. If you installed VoltDB in a different directory, you will need to include your installation path in the -classpath argument. Also, if your client application depends on other libraries, they will need to be included in the classpath as well.

[2] Although VoltDB stored procedures must be written in Java and the primary client interface is Java, it is possible to write client applications using other programming languages. See Chapter 15, Using VoltDB with Other Programming Languages for more information on alternate client interfaces.