Hi, I am trying to connect java with oracle with oci deriver. I have both oracle and java on one machine.
This line works perfectly (doesn't give ClassNotFoundException), taken classes111.zip file into classpath.
What should I write at the place of TNS Names_Entry. Actually what exactly is this TNS Names_Entry. How can I know the value of this in my computer.
Please help me.
Thanks a lot. [ November 13, 2005: Message edited by: rathi ji ]
Arun Prasath
Ranch Hand
Joined: Sep 17, 2003
Posts: 192
posted
0
First, you should have oracle client installed in your machine when you use oracle oci driver.
Then look for the file tnsnames.ora inside "admin" folder of oracle client installation. This file holds the details of the list of services configured by your client.
pick the required service name and use in your java program.
SCJP 1.4, SCDJWS , SCJA<br />I can do ALL things through CHRIST who strengthens me.
ankur rathi
Ranch Hand
Joined: Oct 11, 2004
Posts: 3829
posted
0
I guess, I have both server and client installed. Because I am writing query from SQL plus prompt (I guess, without client, we can't make query) and server is executing the query.
Unfortunately, I can't look this file now.
Is there a direct entry like this in tnsnames.ora file:
Please tell me, what can be wrong here? Thanks. [ November 22, 2005: Message edited by: rathi ji ]
Sri Ram
Ranch Hand
Joined: Oct 03, 2005
Posts: 118
posted
0
I dont know if this will anyway solve ur issue, But it did mine some time back. First, make sure that the jdbc-oci shared object (libocijdbc8 or liboci80Xjdbc.so etc.) and ${ORACLE_HOME}/lib are in your path. Then, try the Test sample program available in the JDBC samples directory. Sometimes, even after the shared object is loaded successfully, you may get errors such as make_c_state symbol not found. This may happen if your CLASSPATH has classes.zip from JRE 1.1.7 or JDK 1.1.6 and your running java binaries from jdk 1.1.3 or so. Make sure everything (LD_LIBRARY_PATH, CLASSPATH, java binaries) is in sync.
Sri Ram
Ranch Hand
Joined: Oct 03, 2005
Posts: 118
posted
0
Sorry forgot to post. I actually got this from Here.
ankur rathi
Ranch Hand
Joined: Oct 11, 2004
Posts: 3829
posted
0
Originally posted by Sri Ram: I dont know if this will anyway solve ur issue, But it did mine some time back. First, make sure that the jdbc-oci shared object (libocijdbc8 or liboci80Xjdbc.so etc.) and ${ORACLE_HOME}/lib are in your path. Then, try the Test sample program available in the JDBC samples directory. Sometimes, even after the shared object is loaded successfully, you may get errors such as make_c_state symbol not found. This may happen if your CLASSPATH has classes.zip from JRE 1.1.7 or JDK 1.1.6 and your running java binaries from jdk 1.1.3 or so. Make sure everything (LD_LIBRARY_PATH, CLASSPATH, java binaries) is in sync.
I am sorry but I didn't get it.
I have classes111.zip into classpath. Using JDK 1.4 and Oracle 8i. Are they not compatible with each other.
You have to make sure that the relevant OCI DLL's (if you're using Windows) are in the PATH (note, that's not the same as classpath).
The error you are getting:
Unsatisfied link error make_c_safe at oracle.jdbc.oci8.OCIDBAccess.make_c_safe
sounds like you do have the DLL's in your path, but you have a wrong (too old or too new) version somewhere.
Why do you want to use the OCI driver anyway? Using the thin driver is easier, if you use the thin driver you don't need the Oracle client software at all (and you wouldn't have problems like the error message above).
edit: Aha, I see you have another post which is exactly the same, except you're asking about the thin driver... :roll: [ November 22, 2005: Message edited by: Jesper de Jong ]