Build the sessions.xml File |
![]() Previous |
![]() Next |
Each TopLink project belongs to a TopLink session. A session is the facade through which an application accesses TopLink functionality. This session information is stored in the sessions.xml file.
For more information, see "Understanding TopLink Sessions" in Oracle Toplink Developer's Guide.
Select File > New > Sessions Configuration. TopLink adds a new sessions element in the Navigator.
Right-click the sessions node in the Navigator and select New > Session. The Create New Session dialog appears. Use this table to enter data in each field on the dialog and click OK.
| Field | Description |
|---|---|
| Name | Session |
| Use Server Platform | Do not select the Use Server Platform option. |
| Select Data Source | Select Database, then select your Platform (such as Oracle Database 10g). |
| Select Session | Select Database Session. |
On the General tab, select the Project subtab. In the Primary Project field, click Edit. The Edit Primary Project dialog appears.
Select XML then click Browse and select the <INTRO_TUTORIAL_HOME>/src/META-INF/Intro_Tutorial.xml file that you created previously (in the "Export the Project Data" section). Click OK to close the Edit Primary Project dialog.
Click the Login tab. Use this table to enter data in each field on the Login tab.
| Field | Description |
|---|---|
| Driver Platform | Select your JDBC platform (such as Oracle Database 10g). |
| Database Driver | Select Driver Manager. |
| Driver Class | oracle.jdbc.OracleDriver |
| URL | jdbc:oracle:thin:@localhost:1521:XE |
| Username | scott |
| Password | tiger |
|
Note: This information should be identical to the login information you entered when you added the database to the project (see "Add the Database"). |
Click the Logging tab. Select the Standard logging option.
For the Logging Level, select Fine. This will allow you to review the generated SQL statements.
Save the session to <INTRO_TUTORIAL_HOME>/src/META-INF/sessions.xml.