Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> OWS 2.0 Java Problem
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);
// 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() ;
}
}
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 CDT
![]() |
![]() |