1 Connecting to a TimesTen Database

You can connect to a TimesTen database after you install and start SQL Developer.

This chapter focuses on the steps necessary to connect to a TimesTen database in SQL Developer. The topics include:

For information about installing and starting SQL Developer, see Oracle SQL Developer User's Guide.

Setting environment variables for TimesTen and SQL Developer

To access a TimesTen database from SQL Developer, install SQL Developer on the same system as the TimesTen Data Manager or TimesTen Client. If you use SQL Developer to access local databases, install SQL Developer on the same system as the TimesTen Data Manager. If you use SQL Developer to access remote databases, install SQL Developer on the same system as the TimesTen Client.

Before you start SQL Developer, execute the TimesTen install_dir/bin/ttenv.sh or TimesTen install_dir/bin/ttenv.csh shell script on Linux systems, or the TimesTen install_dir\bin\ttenv.bat batch file on Microsoft Windows systems. The shell script or batch file adds or modifies the environment variables:

  • CLASSPATH includes the TimesTen install_dir/lib/ttjdbc6.jar file on Linux systems or the TimesTen install_dir\lib\ttjdbc6.jar file on Microsoft Windows systems. SQL Developer 3.0 requires that you have installed Java Development Kit (JDK) 6.

    To determine the third party JDBC drivers SQL Developer is using, select Tools > Preferences. In the Preferences dialog, click the + to the left of the Database node. Select Third Party JDBC Drivers. View the path name of all third party JDBC drivers including the TimesTen JDBC drivers.

  • LD_LIBRARY_PATH includes the TimesTen install_dir/lib directory on Linux systems.

  • PATH includes the TimesTen install_dir/bin directory on Linux systems or the TimesTen install_dir\bin directory on Microsoft Windows systems.

Defining a TimesTen database named connection

To create a named connection to a TimesTen database, right-click the Connections node and select New Connection.

Figure 1-1 Creating a new connection

Description of Figure 1-1 follows
Description of "Figure 1-1 Creating a new connection"

The New/Select Database Connection dialog appears. Choose the TimesTen tab. You are ready to enter information for the connection.

  • In the Connection Name field, type the connection name.

  • In the Username field, type the TimesTen user. If you use the TimesTen database to cache data from an Oracle database, type the TimesTen cache manager user name.

  • In the Password field, type the password for the TimesTen user.

    To save the password, choose Save Password. If you save the password, the Connection Information dialog does not appear on subsequent connections to the TimesTen database.

  • If you use the TimesTen database to cache data from an Oracle database, in the Oracle Password (for Cache) field, type the Oracle password for the Oracle user. The Oracle user must be the same name as the TimesTen user you specified in the Username field.

    Otherwise, leave this field blank.

Figure 1-2 New database connection

Description of Figure 1-2 follows
Description of "Figure 1-2 New database connection"

For DSN, select a predefined DSN that references the TimesTen database. You can select either a Data Manager DSN to establish a direct connection or a client DSN to establish a client/server connection.

If you select User specified, then choose either Client/server to establish a client/server connection or Direct driver to establish a direct connection.

For information about configuring a client/server connection to a TimesTen database, see "Configuring TimesTen Client and Server" in the Oracle TimesTen In-Memory Database Operations Guide.

In the Connection string field, if you selected User specified for the DSN, specify a connection string to define the DSN and set attributes for the DSN. Each attribute setting must be separated by a semicolon. Do not delimit the connection string with a pair of double quotation marks.

For information about the format and contents of a connection string, see "Connecting to a database using a connection string" in the Oracle TimesTen In-Memory Database Operations Guide.

Click Save to save the connection name under the Connections node so that you can establish connections to the database using the settings in the named connection without having to specify the values in the fields of the New/Select Database Connection dialog box again.

Click Connect.

For more information about creating and managing database connections in SQL Developer, see the Oracle SQL Developer User's Guide.

Using an existing TimesTen database named connection

If a named connection for the TimesTen database exists under the Connections node, then right-click the node of the connection name and select Connect, or click the + to the left of the connection name's node.

Figure 1-3 Viewing a TimesTen connection

Description of Figure 1-3 follows
Description of "Figure 1-3 Viewing a TimesTen connection "

If the Connection Information dialog appears, in the Username field, type the TimesTen user name. In the Password field, type the password for the user.

Click OK.

Figure 1-4 Connection Information dialog

Description of Figure 1-4 follows
Description of "Figure 1-4 Connection Information dialog"

After you connect to a TimesTen database, you can browse existing objects or create new objects such as tables, indexes, views, sequences, synonyms, PL/SQL packages, procedures and functions and so on. For information about creating database objects, see the Oracle SQL Developer User's Guide.

Disconnecting an existing TimesTen database connection

To disconnect an existing connection from a TimesTen database, choose the Connections tab. Right-click the node of the connection name and select Disconnect.

For more information, see Figure 1-3, "Viewing a TimesTen connection".