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

Oracle JDBC install on Linux

0 views
Skip to first unread message

Allex Juang

unread,
Apr 11, 2001, 9:27:28 PM4/11/01
to
Hi, I have installed JDK1.3.0-02 on my RH Linux 6.2.
Now I would like to install Oracle onto my host.
Installation is OK except of JDBC driver of Oracle8i.

I set
$CLASSPATH=/usr/jdk1.3.0_02:/u01/app/oracle/product/8.1.7/jdbc/lib/classes11
1.zip
But it doesn't work.
I wrote a little program to test:

import oracle.jdbc.driver.*;
public class test {
public static void main(String[] args) throws SQLException {}
}

Javac reports with "package oracle.jdbc.driver does not exist".
What should I do?

Alex Juang

Allex Juang

unread,
Apr 11, 2001, 11:55:21 PM4/11/01
to
Now, I tried to set
CLASSPATH=/usr/jdk1.3.0_02/jre/lib/rt.jar:/usr/j2sdkee1.3/lib/j2ee.jar:/u01/
app/oracle/product/8.1.7/jdbc/lib/classes111.zip:/u01/app/oracle/product/8.1
.7/jdbc/lib/nls_charset11.zip

And change testing program as:

import java.sql.*;


public class test {
public static void main(String[] args) throws SQLException {

DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection
("jdbc:oracle.thin:@127.0.0.1:1521:ORCL", "scott", "tiger");
}
}


It compiles OK, but while executing it, java reports:

Exception in thread "main" java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:537)
at java.sql.DriverManager.getConnection(DriverManager.java:177)
at test.main(test.java:6)


What is the problem now?


"Allex Juang" <al...@ms2.url.com.tw> 撰寫於郵件
news:9b3093$nv$1...@news.seed.net.tw...

Philip Ross

unread,
Apr 12, 2001, 4:28:53 AM4/12/01
to
"Allex Juang" <al...@ms2.url.com.tw> wrote in message
news:9b38ua$7p3$1...@news.seed.net.tw...

> Now, I tried to set
>
CLASSPATH=/usr/jdk1.3.0_02/jre/lib/rt.jar:/usr/j2sdkee1.3/lib/j2ee.jar:/u01/
>
app/oracle/product/8.1.7/jdbc/lib/classes111.zip:/u01/app/oracle/product/8.1
> .7/jdbc/lib/nls_charset11.zip

You should be using classes12.zip for JDK 1.3, not classes111.zip. If Oracle
8.1.7 doesn't come with them in the jdbc/lib directory, you can download the
from http://technet.oracle.com.

Phil


Allex Juang

unread,
Apr 12, 2001, 4:50:32 AM4/12/01
to
Urrh... I tried using classes12.zip too.
But situation is the same.
Compile OK but not execution.....

"Philip Ross" <phili...@my-deja.com> 撰寫於郵件
news:9b3p0d$jtb$1...@newsg3.svr.pol.co.uk...

Uwe Plonus

unread,
Apr 12, 2001, 5:54:39 AM4/12/01
to

Allex Juang wrote:

<snip>

> import java.sql.*;
> public class test {
> public static void main(String[] args) throws SQLException {
> DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
> Connection conn = DriverManager.getConnection
> ("jdbc:oracle.thin:@127.0.0.1:1521:ORCL", "scott", "tiger");
> }
> }
>
> It compiles OK, but while executing it, java reports:
>
> Exception in thread "main" java.sql.SQLException: No suitable driver
> at java.sql.DriverManager.getConnection(DriverManager.java:537)
> at java.sql.DriverManager.getConnection(DriverManager.java:177)
> at test.main(test.java:6)
>
> What is the problem now?

<snip>

Try it with
Connection conn = DriverManager.getConnection
("jdbc:oracle:thin:@127.0.0.1:1521:ORCL", "scott", "tiger");

It must be a ':' after the oracle not a '.'.

Uwe

Philip Ross

unread,
Apr 12, 2001, 6:32:07 AM4/12/01
to

"Allex Juang" <al...@ms2.url.com.tw> wrote in message
news:9b38ua$7p3$1...@news.seed.net.tw...
> Now, I tried to set
>
CLASSPATH=/usr/jdk1.3.0_02/jre/lib/rt.jar:/usr/j2sdkee1.3/lib/j2ee.jar:/u01/
>
app/oracle/product/8.1.7/jdbc/lib/classes111.zip:/u01/app/oracle/product/8.1
> .7/jdbc/lib/nls_charset11.zip
>
> And change testing program as:
>
> import java.sql.*;
> public class test {
> public static void main(String[] args) throws SQLException {
> DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
> Connection conn = DriverManager.getConnection
> ("jdbc:oracle.thin:@127.0.0.1:1521:ORCL", "scott", "tiger");
> }
> }

The problem is actually to do with the jdbc url. You have

jdbc:oracle.thin

it should actually be

jdbc:oracle:thin

Phil


0 new messages