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: test.java 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

Roland

This is my test.jsp program:




<%@ page info="database handler"%>
<%@ page import="java.io.*"%>
<%@ page import="java.util.*"%>
<%@ page import="java.sql.*"%>

<%@ page import="javax.servlet.*"%>
<%@ page import="javax.servlet.http.*"%>
<%

try
{
Connection con=null;
Statement stmt=null;
ResultSet rs=null;
String createString=null;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

String url="jdbc:odbc:test";
con = DriverManager.getConnection(url,"scott", "tiger");
createString="select FIRST_NAME,EMPLOYEE_ID,SALARY from
emp";
stmt=con.createStatement();    ;
rs = stmt.executeQuery(createString);

while (rs.next())
{
String col1 = rs.getString(1);
String col2 = rs.getString(2);

out.println("<tr><td>"+col1+"</td><td>"+col2+"</td></tr>");
}
out.println("</table>");
}
catch (Exception e) {}
%>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to