Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Oracle's JDBC Thin Client
Hi All,
I wrote a test applet trying to query a database residing on an Oracle webserver by using a jdbc thin driver.
The applet is on same server as the database. The code is like this:
import java.sql.*; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; import java.awt.*; import java.io.*; import java.util.*;
public class JdbcApplet extends java.applet.Applet
{
public void init()
{
TextArea messager=new TextArea (2,20);
String username = "test";
String password = "test";
Connection conn;
add(messager);
try{
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
messager.append("test1");
conn=
DriverManager.getConnection("jdbc:oracle:thin:@192.84.84.225:1526:orcl",
username, password);
messager.append("test2");
Statement stmt = conn.createStatement (); ResultSet rset = stmt.executeQuery ("select KEYWORD from hercules.PAGES");
while (rset.next ())
{
messager.append(rset.getString (1)); };
} catch (Exception e) {messager.appendText(e.getMessage());} }
}
When I call the applet from the server using my account, it runs fine. When I call it from any other machine, or even when I calI it from another account on the server I get the SQLException :no suitable driver.
I used the getDrivers method of DriverManager and found that OracleDriver is
loaded (tested in any machine). So I suppose that the problem is in the
getConnection method.
But then, how can the applet work fine for me and not for everybody?
Any comments/suggestions would be greatly appreciated!
Thanks in advance,
Hercules.
Received on Thu Jun 11 1998 - 00:00:00 CDT
![]() |
![]() |