|Oracle® TimesTen In-Memory Database Java Developer's Guide
Part Number E13068-08
This chapter provides information about the Java development environment and related considerations. It includes the following topics:
Install and configure TimesTen for your environment, as described in Oracle TimesTen In-Memory Database Installation Guide, and the Java JDK, as described in your Java installation documentation. As you set up a Java development environment, the topics of particular interest in Oracle TimesTen In-Memory Database Installation Guide include the following:
After you have installed and configured TimesTen, create a database DSN as described in "Managing TimesTen Databases" in Oracle TimesTen In-Memory Database Operations Guide. The topics of particular interest include the following:
Before you begin developing Java applications for TimesTen, you must set your environment appropriately. This includes the following considerations:
Environment variables must be set appropriately. See "Java environment variables" in Oracle TimesTen In-Memory Database Installation Guide for more information about environment variables for Java, including discussion of the
THREAD_FLAGS, and shared library path environment variables.
Use the appropriate
ttenv script to set up environment variables and runtime access to the Instant Client.
On UNIX platforms, execute one of the following scripts.
On Windows, run the following:
"Java environment variables" in Oracle TimesTen In-Memory Database Installation Guide discusses the
CLASSPATH setting for compiling Java applications in TimesTen.
Compiling any Java application requires the JAR file appropriate for your JDK to be in your classpath. In TimesTen, the following are for JDK 5.0 and JDK 6.0, respectively:
In addition, compiling any JMS/XLA application requires the following to be in your classpath:
install_dir/lib/timestenjmsxla.jar install_dir/3rdparty/jms1.1/lib/jms.jar install_dir/lib/orai18n.jar
After you have configured your Java environment, you can confirm that everything is set up correctly by compiling and running the TimesTen Quick Start demo applications. Refer to the Quick Start welcome page at
/quickstart.html, especially the links under SAMPLE PROGRAMS, for information about the following:
Demo schema and setup
build_sampledb script creates a sample database and demo schema. You must run this before you start using the demos.
Demo environment and setup
ttquickstartenv script, a superset of the
ttenv script generally used for TimesTen setup, sets up the demo environment. You must run this each time you enter a session where you want to compile and run any of the demos.
Demos and setup
TimesTen provides demos for JDBC and JMS/XLA under the
quickstart/sample_code directory. For instructions on compiling and running the demos, see the README file or files in the subdirectories.
What the demos do
A synopsis of each demo is provided when you click JDBC (Java) under SAMPLE PROGRAMS. The TimesTen basic Java demos are named
level4. Data files for the
level demos are in the
Note:All of the
leveldemos support both direct and client/server connections to the database.