Oracle8i Java Developer's Guide Release 3 (8.1.7) Part Number A83728-01 |
Library | Service | Contents | Index

## How To Tell You Are Executing in the Server

You might want to write Java code that executes in a certain way in the server and another way on the client. In general, Oracle does not recommend this. In fact, JDBC and SQLJ go to some trouble to enable you to write portable code that avoids this problem, even though the drivers used in the server and client are different.

If you must determine whether your code is executing in the server, use the `System.getProperty` method, as follows:

    System.getProperty ("oracle.jserver.version")

The `getProperty` method returns the following:

- If executing in the server, returns a `String` that represents the Oracle8i database version ("8.1.5" or "8.1.6").

- If executing on the client, returns null.

| Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
Library | Service | Contents | Index