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
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...
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
"Philip Ross" <phili...@my-deja.com> 撰寫於郵件
news:9b3p0d$jtb$1...@newsg3.svr.pol.co.uk...
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
The problem is actually to do with the jdbc url. You have
jdbc:oracle.thin
it should actually be
jdbc:oracle:thin
Phil