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 dbc: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) {}
%>