File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes I still haven't had an answer for this... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "I still haven Watch "I still haven New topic

I still haven't had an answer for this...

Richard Vagner
Ranch Hand

Joined: Jun 26, 2001
Posts: 108
I have installed tomacat to set up Oracle JDBC-ODBC driver,
data source... but ran into some problmes:
The database connection with Oracle only works with .java
files but does not work with jsp files.
For example: would work but test.jsp would not.
This is the error message I got when running with test.jsp:
"OCI.DLL: One of the library files needed to run this
appliction cannot be found". Can anyone tell me what might
be the problem? I checked the dll dependency for OCI.DLL,
all dll files are there.
Please help
This is my test.jsp program:

<%@ page info="database handler"%>
<%@ page import="*"%>
<%@ page import="java.util.*"%>
<%@ page import="java.sql.*"%>
<%@ page import="javax.servlet.*"%>
<%@ page import="javax.servlet.http.*"%>
Connection con=null;
Statement stmt=null;
ResultSet rs=null;
String createString=null;
String url="jdbc dbc:test";
con = DriverManager.getConnection(url,"scott", "tiger");
createString="select FIRST_NAME,EMPLOYEE_ID,SALARY from
stmt=con.createStatement(); ;
rs = stmt.executeQuery(createString);
while (
String col1 = rs.getString(1);
String col2 = rs.getString(2);
catch (Exception e) {}
Roy Ben Ami
Ranch Hand

Joined: Jan 13, 2002
Posts: 732
what do u mean it works with java and not jsp files?
the connection should be the same no? whats the differnce?
how did u try to run it as jsp?
Richard Vagner
Ranch Hand

Joined: Jun 26, 2001
Posts: 108
Thanks, Roy,
I finally got a response from you. What I mean by is I created a file called it contains jdbc code used to connect to Oracle database using JDBC-ODBC bridge. I compiled it and run it and it works. However I could not have it work in test.jsp which has basically the same code as but with jsp format. When test.jsp is activated:
http://localhost:8080/jsp/test.jsp I got the error metioned in the previous message. I am trying to figure out what library files are missing. It seems to me after checking the OCI.DLL dependency with MS's dependency walker, all required dll files are there. So what is the problem?
Thanks for your help
Roy Ben Ami
Ranch Hand

Joined: Jan 13, 2002
Posts: 732
listen i dont understand in this much but i did a little hunting across the web.
your problem is a common one and i saw couple of solutions.
its a problem witht he oracle database.
here is one solution:

Connection problems
The 32bit applications all connect directly to Oracle using the OCI (Oracle Call Interface.) Our applications are sensitive to incorrect Oracle settings in your registry (more so than Oracle's applications which are generally installed in the same directory as SQLNet/Net8.)
Possible Quickfix:
There is a new 'Options...' button on the login window (you have to click the More>> button first to see it.) If you click the options button you will see the 'Login Window Options' window. There is a field called 'OCI DLL' which you should set to the correct value. The correct value should be something like 'ora73.dll' or 'ora805.dll' depending upon what version of Oracle's required support files you have installed. You can usually just look in your [oracle_home]\bin directory and use the highest oraxxx.dll file that you find.
Other suggestions:
Make sure that you create an alias for your database using Easy Config or Net8 Assistant. If you are using Oracle Names then make sure that it is setup correctly.
Use TNSPING.EXE to ping your alias. (i.e. tnsping aliasname.) TNSPING.EXE should be in your ORACLE_HOME\bin directory.
Make sure that you have a registry key called HKey_Local_Machine\Software\Oracle (This can be missing when SQLNet/Net8 is installed by hand or with a script and not from the Oracle CD.

In general our products will check your machine's registry settings to determine the correct Oracle Home directory and then search that directory for the correct Oracle OCI .dll file to use. Incorrect registry settings and 'orphaned' OCI dll files can sometimes confuse our products. A cleanly installed SQLNet or Net8 should always work! Oracle does not clean up its registry settings when you uninstall products, so be aware that if you install Net8.1 and then remove it, that those settings are still in your registry and can cause problems.

if it doesnt help try searching in for the oci.dll u mentioned.
you'll find a lot of links about that.
I agree. Here's the link:
subject: I still haven't had an answer for this...
It's not a secret anymore!