Re: Oracle's JDBC Thin Client

From: Thomas Belt <thomasb_at_the-codebook.com>
Date: 1998/06/11
Message-ID: <01bd9587$8a8ef470$165c61c2_at_timba>#1/1


Perhaps our code-example section or our troubleshooting section can help you
further.
Take a look at: www.the-codebook.com hit the search button and either select:
"Search in problems" or "Search in troubleshooting" Enter Oracle as a search pattern in either case.

Hope this helps
Tom

-- 
|   Thomas Belt (thomasb_at_the-codebook.com) 
|    Java Programmer's Resource (http://www.The-Codebook.com)



mcaighv2 <mcaighv2_at_stud.umist.ac.uk> wrote in article
<6lou02$k5p$2_at_yama.mcc.ac.uk>...

> 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:_at_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 CEST

Original text of this message