Obtain an Axion binary from the downloads page, or build Axion from scratch.
To run Axion, you'll need the following JARs in your classpath:
- Commons-Collections (2.1 or later)
- Commons-Primitives (1.0 or later)
- Commons-Logging (1.0 or later)
- Commons-Codec (1.1 or later)
http://jakarta.apache.org/commons/codec/
(Only needed if you'd like to use the BASE64ENCODE and BASE64DECODE functions.)
Currently Axion only runs as an in-process database. The database engine classes are executed in the same VM as your client code.
Axion supports both transient (in-memory) and persistent modes.
The data in a transient database disappears when the database
is SHUTDOWN
or the VM exits. These are
suitable for unit testing database applications, or for
temporary work areas.
Persistent databases are disk-based. Their data persists
beyond the lifespan of a single Java VM. Note that it is possible
to create transient tables within a persistent database. The transient
tables will disappear on SHUTDOWN
or when the VM
exits, while the disk-based table will continue to persist.
Axion is thread-safe, and supports as many concurrent connections as your your client code creates. Like other JDBC engines, it's safest to use each Connection in at most one thread at a time.
To create a new Axion database you simply connect to it--if it doesn't already exist, it will be created. See Connecting to an Axion Database.
Axion databases can be accessed via the JDBC interface.
AxionDriver
is the factory for creating
JDBC connections to an Axion database, and may be registered with the
DriverManager
in the common ways:
Class.forName
on (or
otherwise instantiating)
"org.axiondb.jdbc.AxionDriver"
:
Class.forName("org.axiondb.jdbc.AxionDriver");
jdbc.drivers
property:
java -Djdbc.drivers=org.axiondb.jdbc.AxionDriver ...
JDBC Connection
s can then be obtained from the DriverManager
:
Connection conn = DriverManager.getConnection(axion-connect-string);
Where the axion-connect-string takes the form:
jdbc:axiondb:database-name[:database-directory]
The database-name is the name of the database, similar to an Oracle SID. The optional database-directory specifies the (relative or absolute) directory in which the database files will be found or created. When the database-directory is omitted, a transient database is created.
To run Axion, you'll need the Axion's JAR (axiondb-*.jar
)
and the requisite third-party JARs in your CLASSPATH.
Axion includes a simple console-based JDBC/SQL client application that you can use to experiment or interact with an Axion database. To use it, simple invoke:
java -cp axiondb.jar:commons-collections.jar:commons-primitives.jar:commons-logging.jar \ org.axiondb.tools.Console dbname [dbpath]
or on Windows:
java -cp axiondb.jar;commons-collections.jar;commons-primitives.jar;commons-logging.jar \ org.axiondb.tools.Console dbname [dbpath]
You can enter arbitrary SQL commands and queries via the console. For example:
See tools for more on the Axion console and other JDBC/SQL clients.
Axion can be used like any other database that supports JDBC. Using Axion via JDBC shows a simple example.
(A complete tutorial on JDBC is beyond the scope of this document. For more on JDBC, see http://java.sun.com/jdbc/.)
The test
directory (and the
test/org/axiondb/functional
directory in particular) contains literally hundreds of examples of
using Axion via JDBC.