Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Applet to Oracle 8i Connection

0 views
Skip to first unread message

r.appleby

unread,
Feb 19, 2001, 4:52:47 PM2/19/01
to
I m using the following code to connect to an Oracle DB through
an applet but I keep getting the error shown below. What am I
doing wrong?<P>
My applet resides on a server, and has the drivers in the same
directory as the .class files.
<P>
public Connection ConnectDatabase() {<P>
// Load Oracle jdbc driver.<P>
try {<P>
Class.forName("oracle.jdbc.dnlddriver.OracleDriver");<P>
}<P>
catch(ClassNotFoundException e) {<P>
e.printStackTrace();<P>
}<P>
// Choose server.<P>
String url = null;<P>
url = "jdbc:oracle:dnlddriver:@www.mydomain.com:1234:orasid";<P>
// Connect to database.<P>
Connection con = null;<P>
try {<P>
con = DriverManager.getConnection(url, "usern", "pword");<P>
}<P>
catch(Exception e) {<P>
System.out.println(url + " connection failed" + '\n');<P>
}<P>
<P>
return con;<P>
}<P>

<P>
---------------------------------------------------------------
<P>ERROR I GET<P>
java.sql.SQLException: No suitable driver
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at java.sql.SQLException.<init>(Compiled Code)
at java.sql.DriverManager.getConnection(Compiled Code)
* at java.sql.DriverManager.getConnection(Compiled Code)
at aciRego.ConnectDatabase(Compiled Code)
at aciRego.init(Compiled Code)
at
netscape.applet.DerivedAppletFrame$InitAppletEvent.dispatch(Compi
led Code)
at
java.awt.EventDispatchThread$EventPump.dispatchEvents(Compiled
Code)
at java.awt.EventDispatchThread.run(Compiled Code)
at
netscape.applet.DerivedAppletFrame$AppletEventDispatchThread.run(
Compiled Code)
<P>----------------------------------------------------------<P>
Please help
<A HREF="mailto:rapp...@balgownierangers.com">Mail Me</A>

0 new messages