18 June 2009

Weblogic Server DataSource Using TNS Names

As of Oracle JDBC 10.2, it's possible to establish a connection with the thin driver using tnsnames.


This allows you to store your database server details in an external tnsnames.ora file, which you then reference from the JDBC connection URL.

To use this with a Weblogic Server DataSource, try the following:

  1. Create a tnsnames.ora file with the required connection details and store it in a file that is accessible to the WLS instance:
    TEST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = testserver)(PORT = 1521))
    (SERVICE_NAME = test.au.oracle.com)

  2. Edit the setDomainEnv script for your domain and add the following System property

  3. Create a DataSource and specify the connection URL to use the TNS names entry:

When the connection pool needs to create connections, it will lookup and use the specified TNS names entry from tnsnames.ora file in the directory specified oracle.net.tns_admin property.

12 June 2009

Displaying Server details in OEPE

When you have a Server defined in your OEPE environment, double-clicking on the icon presents the configuration page as shown below. For a single page, it's quite rich in detail, giving you access to the domain directories (assuming its local), the properties of the Server connection itself, how publishing is performed, and even a list of deployed modules in the domain.

Clicking on the "Open WebLogic Server Console" link opens the WLS Console directly within the Eclipse environment, where you can manage the server and all its resources as normal.

I found that when doing this with WLS 10.3.x caused any publishing events to fail since the WLS Console automatically acquires the edit lock in development mode, which prevents Eclipse from performing any application updates. Seems you'd need to to configure the use of Use Lock and Edit mode if you wanted to make use of this.

01 June 2009

WebLogic Schema Definitions

WebLogic Schema Definitions are available from this Oracle site: