I guess, just the "import oracle.jdbc.driver.*" won't help,
because you are loading the driver-class with the full name,
(classpath + package + class ==>
Class.forName("oracle.jdbc.driver.OracleDriver"))
...that's ok.
First of all you have to add the Classes12.zip to your classpath,
so that you can compile it (as you did it). But that doesn't mean,
that it will run, too.
You also have to unzip the files into the classpath of your Webserver.
I.g. if you are using JavaWebServer, the default classpath includes
$server_root$/classes/
So you can unzip them into this folder, which will give you the
following directory tree...
$server_root$/classes/
|- oracle/
| |- ...
| |- jdbc/
| | |- ...
| | |- driver/
| | | |- ...
| | | |- OracleDriver.class
|- javax/
|- ...
Try this out.
Greetings
Andi
-----Original Message-----
From: devstuff [mailto:[EMAIL PROTECTED]]
Sent: Freitag, 16. Februar 2001 13:02
To: SERVLET-INTEREST
Cc: devstuff
Subject: AW: Error in Connecting to Oracle
Perhaps thats what you are missing:
import oracle.jdbc.driver.*;
-----Ursprüngliche Nachricht-----
Von: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]Im Auftrag von
Shukla, Amit
Gesendet: Freitag, 16. Februar 2001 00:19
An: [EMAIL PROTECTED]
Betreff: Re: Error in Connecting to Oracle
Environment: Weblogic 5.1.0 , Oracle 8i. Driver: Thin Driver
I have put the Classes12.zip of Oracle in classpath. But Still when I run my
code I get the error
----------
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
java.lang.NullPointerException:
---------------------------
My code is as usual:
---------------------------
Class.forName("oracle.jdbc.driver.OracleDriver");
conn = DriverManager.getConnection("jdbc:oracle:thin:NEXTSTEP:1528:ORCL",
"MTS", "MTS");
----------------------
What could be the problem for this ???? I'm just practicing for myself, so
if somebody suggest me to use different driver to be able to connect to
Oracle then I am ready to do that.
Please help me.
-----Original Message-----
From: sharma Sumeet [mailto:[EMAIL PROTECTED]]
Sent: 02/15/2001 02:19
To: [EMAIL PROTECTED]
Subject: Re: Error in Connecting to Oracle
hi
which driver type r u using,,,,,,,,
sumeet
> -----Original Message-----
> From: Shukla, Amit [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, February 14, 2001 2:28 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Error in Connecting to Oracle
>
> I did change my path and now I'm getting this error
>
> ==========
> ...
> ...
> ---------- LOGIN ERROR CODE: 24327
> Wed Feb 14 13:24:38 CST 2001:<I> <JDBC Pool> Sleeping in createResource()
> Wed Feb 14 13:24:39 CST 2001:<E> <JDBC Pool> Failed to create connection
> pool "oraclePool"
> weblogic.common.ResourceException: weblogic.common.ResourceException:
> Could not create pool connection. The DBMS driver exception was:
> java.sql.SQLException: ORA-24327: need explicit attach before
> authenticating
> a user - (MTS/********)
>
> at
> weblogic.db.oci.OciConnection.getLDAException(OciConnection.java:143)
> at weblogic.jdbcbase.oci.Driver.connect(Driver.java:157)
> at java.sql.DriverManager.getConnection(DriverManager.java:457)
> at java.sql.DriverManager.getConnection(DriverManager.java:137)
> at
> weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(Connecti
> on
> EnvFactory.ja
> va:172)
> at
> weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(Connecti
> on
> EnvFactory.ja
> va:109)
> at
> weblogic.common.internal.ResourceAllocator.makeResources(ResourceAllocator
> .j
> ava, Compiled
> Code)
> at
> weblogic.common.internal.ResourceAllocator.<init>(ResourceAllocator.java,
> Compiled Code)
> at
> weblogic.jdbc.common.internal.ConnectionPool.startup(ConnectionPool.java:3
> 30
> )
> at weblogic.jdbc.common.internal.JdbcInfo.initPools(JdbcInfo.java,
> Compiled Code)
> ...
> ...
> ====================================
>
> What could be the problem in this ???
>
> Amit
>
> -----Original Message-----
> From: kavitha Ramasamy [mailto:[EMAIL PROTECTED]]
> Sent: 02/12/2001 04:02
> To: [EMAIL PROTECTED]
> Subject: Re: Error in Connecting to Oracle
>
>
> Set your path to weblogic\bin\oci815_8 where weblogicoci dll file is
> residing.
>
> Kavitha.
> ----- Original Message -----
> From: "Shukla, Amit" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, February 12, 2001 4:20 PM
> Subject: Error in Connecting to Oracle
>
>
> > Hello,
> > This is the first time I'm trying to connect to Oracle from my
> > servlet on Weblogic 5.1. I have Oracle 8i on my machine. In the
> > Weblogic.properties file, I have added the following code:
> > =============
> > weblogic.jdbc.connectionPool.oraclePool=\
> > url=jdbc:weblogic:oracle,\
> > driver=weblogic.jdbc.oci.Driver,\
> > loginDelaySecs=1,\
> > initialCapacity=4,\
> > maxCapacity=10,\
> > capacityIncrement=2,\
> > allowShrinking=true,\
> > shrinkPeriodMins=15,\
> > refreshMinutes=10,\
> > testTable=dual,\
> > props=user=MTS;password=MTS;server=NEXTSTEP
> >
> > weblogic.allow.reserve.weblogic.jdbc.connectionPool.oraclePool=\
> > MTS
> > weblogic.allow.reset.weblogic.jdbc.connectionPool.oraclePool=\
> > MTS
> > weblogic.allow.shrink.weblogic.jdbc.connectionPool.oraclePool=\
> > MTS
> > ============================
> > When I run my Weblogic server it gives the following message:
> > =====================
> > ...
> > ...
> > Delaying 1 seconds before making a oraclePool pool connection.
> > java.sql.SQLException: System.loadLibrary threw
> > java.lang.UnsatisfiedLinkError
> > with the message 'no weblogicoci36 in java.library.path'.
> > at weblogic.jdbcbase.oci.Driver.connect(Driver.java:116)
> > at
> >
> weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(Connecti
> on
> > EnvFactory.ja
> > va:149)
> > at
> >
> weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(Connecti
> on
> > EnvFactory.ja
> > va:109)
> > at
> >
> weblogic.common.internal.ResourceAllocator.makeResources(ResourceAllocator
> .j
> > ava, Compiled
> > Code)
> > at
> >
> weblogic.common.internal.ResourceAllocator.<init>(ResourceAllocator.java,
> > Compiled Code)
> > at
> >
> weblogic.jdbc.common.internal.ConnectionPool.startup(ConnectionPool.java:3
> 30
> > )
> > at
> weblogic.jdbc.common.internal.JdbcInfo.initPools(JdbcInfo.java,
> > Compiled Code)
> > at
> weblogic.jdbc.common.internal.JdbcInfo.startup(JdbcInfo.java:200)
> > at
> > weblogic.jdbc.common.internal.JdbcStartup.main(JdbcStartup.java:11)
> > at java.lang.reflect.Method.invoke(Native Method)
> > at
> weblogic.t3.srvr.StartupThread.runMain(StartupThread.java:219)
> > at weblogic.t3.srvr.StartupThread.doWork(StartupThread.java,
> > Compiled Code)
> > at
> >
> weblogic.t3.srvr.PropertyExecuteThread.run(PropertyExecuteThread.java:62)
> > Mon Feb 12 15:01:45 CST 2001:<I> <JDBC Pool> Sleeping in
> createResource()
> > Mon Feb 12 15:01:46 CST 2001:<E> <JDBC Pool> Failed to create connection
> > pool "oraclePool"
> > weblogic.common.ResourceException: weblogic.common.ResourceException:
> > Could not create pool connection. The DBMS driver exception was:
> > java.sql.SQLException: System.loadLibrary threw
> > java.lang.UnsatisfiedLinkError
> > with the message 'no weblogicoci36 in java.library.path'.
> > at weblogic.jdbcbase.oci.Driver.connect(Driver.java:116)
> > at java.sql.DriverManager.getConnection(DriverManager.java:457)
> > at java.sql.DriverManager.getConnection(DriverManager.java:137)
> > ....
> > ....
> > ==================================
> > That is why when I try to connect to oracle thrugh my code then it gives
> me
> > NullPointerException
> >
> > Could you please let me know, what special settings do I need to do for
> > WebLogic in order to Connect to Oracle.
> >
> > Thanks.
> >
> >
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html