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/ttjdbc7.jar file on Linux systems or the TimesTen install_dir\lib\ttjdbc7.jar file on Microsoft Windows systems. SQL Developer 4.0 requires that you have installed Java Development Kit (JDK) 7.

    To determine the third party JDBC drivers SQL Developer is using, from the Tools menu, select 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, make sure you are on the main SQL Developer page.

  1. 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.

  2. Select the TimesTen tab.

    Figure 1-2 New database connection

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

    You are ready to enter information for the connection.

  3. In the Connection Name field, enter the connection name.

  4. In the Username field, enter the TimesTen user. If you use the TimesTen database to cache data from an Oracle database, enter the TimesTen cache manager user name. If you use the TimesTen database to load data from an Oracle database, enter the TimesTen user name that has SELECT privileges on the Oracle database tables that you want to load.

  5. In the Password field, enter the password for the TimesTen user.

    To save the password, choose Save Password. If you save the password, you will not be prompted for the password on subsequent connections to the TimesTen database.

  6. To allow TimesTen to issue an implicit commit after DML statements, select the Autocommit check box. By default, the Autocommit check box is selected.

  7. Select a connection type from the Connection Type drop-down list. The following types of connections are available:

    Figure 1-3 New connection type

    Description of Figure 1-3 follows
    Description of "Figure 1-3 New connection type"

    You are now ready to define your new connection.

DSN

The DSN connection type allows you to connect to databases by specifying a DSN. The DSN must exist in your .ODBC.INI on UNIX and the ODBC Data Source Administrator on Windows. Before defining a DSN connection in SQL Developer, make sure you have completed the steps up to step 7 from "Defining a TimesTen database named connection".

Note:

For more information about defining DSNs, see "Specifying Data Source Names to identify TimesTen databases" in the Oracle TimesTen In-Memory Database Operations Guide.
  1. Select a predefined DSN that references the TimesTen database from the DSN drop-down list. You can select either a Data Manager DSN to establish a direct connection or a client DSN to establish a client/server connection.

  2. In the Connection Attributes field, enter the attributes for the DSN. The Connection Attributes field is not required. Each attribute setting must be separated by a semicolon. If you do not specify any connection attributes, TimesTen uses the connection attributes specified in the DSN.

    For more information about connection attributes, see "Connection Attributes" in the Oracle TimesTen In-Memory Database Reference.

  3. To cache data from an Oracle database or load data from an Oracle database into a TimesTen database, select the Enable Cache/Load tables from Oracle database check box.

  4. In the Oracle Database Password field, enter the Oracle database password for the Oracle database user. The Oracle database user must be the same user as the TimesTen user you specified in the Username field. This text field is only available if you selected the Enable Cache/Load tables from Oracle database check box.

  5. Click Save to save the connection name under the Connections node.

    Figure 1-4 Save DSN connection

    Description of Figure 1-4 follows
    Description of "Figure 1-4 Save DSN connection"

    Your connection is saved. 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.

  6. Click Connect.

    SQL Developer is connected to your TimesTen database.

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

Easy Client/Server

The easy client/server connection type allows you to connect to local and remote databases without having to define a DSN. Before defining an easy client/server connection in SQL Developer, make sure you have completed the steps up to step 7 from "Defining a TimesTen database named connection".

  1. In the Server Host Name field, enter the name or the IP address of the TimesTen server host.

  2. In the Server DSN field, enter the DSN of the TimesTen database that is located on the TimesTen server host.

  3. In the Server Port field, enter the TCP port of the TimesTen server. You can use the ttStatus utility to find the TCP port of your TimesTen server.

    In the following example, the server port number is 53396. This example is part of a sample output from the ttStatus utility.

    TimesTen server pid 24379 started on port 53396
    

    For more information about the ttStatus utility, see "ttStatus" in the Oracle TimesTen In-Memory Database Reference.

  4. To cache data from an Oracle database or load data from an Oracle database into a TimesTen database, select the Enable Cache/Load tables from Oracle database check box.

  5. In the Oracle Database Password field, enter the Oracle database password for the Oracle database user. The Oracle database user must be the same user as the TimesTen user you specified in the Username field. This text field is only available if you selected the Enable Cache/Load tables from Oracle database check box.

  6. In the Oracle Net Service Name field, enter the Oracle database net service name for the Oracle database. This text field is only available if you selected the Enable Cache/Load tables from Oracle database check box.

  7. Click Save to save the connection name under the Connections node.

    Figure 1-5 Save easy client/server connection

    Description of Figure 1-5 follows
    Description of "Figure 1-5 Save easy client/server connection"

    Your connection is saved. 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.

  8. Click Connect.

    SQL Developer is connected to your TimesTen database.

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

Advanced

The advanced connection type allows you to define a connection string to connect to your TimesTen database. Before defining an advanced connection in SQL Developer, make sure you have completed the steps up to step 7 from "Defining a TimesTen database named connection".

  1. Select a driver type for the TimesTen database from the Driver Type option. Select either Client/server to establish a client/server connection or Direct to establish a direct connection.

  2. In the Connection string field, enter a connection string to define the DSN and set attributes for the DSN. If you choose Client/Server as the Driver Type specify the server host, server port, and 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.

  3. To cache data from an Oracle database or load data from an Oracle database into a TimesTen database, select the Enable Cache/Load tables from Oracle database check box.

  4. In the Oracle Database Password field, enter the Oracle database password for the Oracle database user. The Oracle database user must be the same user as the TimesTen user you specified in the Username field. This text field is only available if you selected the Enable Cache/Load tables from Oracle database check box.

  5. Click Save to save the connection name under the Connections node.

    Figure 1-6 Save advanced connection

    Description of Figure 1-6 follows
    Description of "Figure 1-6 Save advanced connection"

    Your connection is saved. 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.

  6. Click Connect.

    SQL Developer is connected to your TimesTen database.

    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-7 Viewing a TimesTen connection

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

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

Click OK.

Figure 1-8 Connection Information dialog

Description of Figure 1-8 follows
Description of "Figure 1-8 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-7, "Viewing a TimesTen connection".