This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes ocijdbc10 driver Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "ocijdbc10 driver" Watch "ocijdbc10 driver" New topic
Author

ocijdbc10 driver

faisal hameed
Ranch Hand

Joined: Jan 19, 2009
Posts: 48
Hi Ranchers. I want to connect my application with oracle 10.I am exporting LD_LIBRARY_PATH in profile
as follow from linux.
Am i exporting correct?

LD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/u01/app/oracle/product/10.2.0/db_1/lib
export LD_LIBRARY_PATH

PATH=$PATH::/u01/app/oracle/product/10.2.0/db_1/bin
export PATH

I also set the class path to the ojdbc14.jar file.But i am getting the following exception.Where I am wrong.



Regards, M Faisal Hameed
PUCIT, Pakistan
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Just a question: do you really need to use the OCI driver?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
faisal hameed
Ranch Hand

Joined: Jan 19, 2009
Posts: 48
yes i need it because i have to use it.
Sandeep Sanaboyina
Ranch Hand

Joined: Dec 14, 2009
Posts: 72
Do you really need to set the LIBRARY_PATH Using the driver jar in the classpath should be sufficient to connect to the DB.


They say you have to be the first, the best or different. I say, is it too much to ask for all three.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Sandeep Sanaboyina wrote:Do you really need to set the LIBRARY_PATH Using the driver jar in the classpath should be sufficient to connect to the DB.

This is true, only if faisal is using a type 4 driver, which isn't the case.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

faisal hameed wrote:yes i need it because i have to use it.


Fair enough. I only ask because many people posting in this form are not aware of the differences.

I'm afraid I don;t have an answer to your problem. Assuming the OCI dependencies are in your PATH this should work. Have you checked what java.library.path actually includes?
Sandeep Sanaboyina
Ranch Hand

Joined: Dec 14, 2009
Posts: 72
Paul Sturrock wrote:[This is true, only if faisal is using a type 4 driver, which isn't the case.

Did not know this... Nice learning though. Thanks .
faisal hameed
Ranch Hand

Joined: Jan 19, 2009
Posts: 48
I am using (java -server -classpath "lib/ts.jar:lib/ojdbc14.jar:lib/mail.jar:lib/activation.jar") this line in a file(Server.sh).
These jar files are in my lib folder and Server.sh and lib folder in same folder.
By executing Server.sh from terminal I am getting this exception.

Exception in thread "main" java.lang.UnsatisfiedLinkError: no ocijdbc10 in java.library.path
Now what i have to do?
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

OK. Have you logged what java.library.path is?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: ocijdbc10 driver
 
Similar Threads
package oracle.jdbc.driver does not exist
Using Netbean 6.8 to create a Servlet app that queries a database
SQLException: Io exception: There is no process to read data written to a pipe.
Jboss7 + Oracle 11g - ocijdbc11.dll: Can't find dependent libraries
error msg UnsatisfiedLinkError t2cGetCharSet