Java On OWS 2.0 Problems

From: Yoav Ben-Yaar <yoav_at_i-labs.co.il>
Date: 1997/06/15
Message-ID: <33A3C95F.5E7_at_i-labs.co.il>#1/1


I'm having a problem trying to run a sample java program that opens a connection to the dbs.
What happens is that the web listner that runs the example crashes and neads to be restarted.

The setup is OWS 2.0 running on Windows NT 4.0. (All other sample java programs that don't open a connection to the dbs work fine)

source follows:

import oracle.html.*;
import oracle.rdbms.*; // ADD: import Oracle classes

public class test {

  public static void main (String args[]) {

    HtmlHead hd = new HtmlHead("Test");
    HtmlBody bd = new HtmlBody();
    HtmlPage hp = new HtmlPage(hd, bd);

    hp.printHeader();     

    // ADD: defines Oracle session properties like ORACLE_HOME
    Session.setProperty("ORACLE_HOME", "c:\\orant");     Session.setProperty("TNS_ADMIN", "c:\\orant\\network\\ admin");

    // ADD: creates a database session and logon     Session session;
    try {
      session = new Session("scott", "tiger", "ORCL");
} catch (ServerException e) {

      bd.addItem(new SimpleItem("Logon fails: " + e.getSqlerrm()));

      hp.print();
      return;

    }     

    bd.addItem(new SimpleItem("Logon is OK!!!"));     hp.print() ;     

     try {
      session.logoff() ;

} catch (ServerException e) {} ;
 

  }
}

The example is taken from the OWS documentation. changes made - properties ORACLE_HOME and TNS_ADMIN changed to what seems correct on NT.

What am I doing wrong ? Any ideas ? Received on Sun Jun 15 1997 - 00:00:00 CEST

Original text of this message