Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> unable to connect to a DBF db under OAS using servlet
Hi:
I have recently deployed some servlets under OAS. All of them work perfect except one in which I am trying to connect to a set of DBF tables. I get the following error:
An error occured attempting to run this servlet. The most likely explanation is a problem specific to the servlet being invoked.
On debugging it seems the servlet crashes at line:
Connection con = DriverManager.getConnection(url1, "", ""); which means there is something wrong with:
String url1 = "jdbc:DBF:/"+"D:/temp/upload";
I tested below code under Tomcat and it appears to work perfect. I also checked whether the directory D:/temp/upload exists and yes it does. Could someone please suggest something.
try
{
response.setContentType(CONTENT_TYPE);
String databaseDriverName = "com.hxtt.sql.dbf.DBFDriver";
Class.forName(databaseDriverName).newInstance();
String url1 = "jdbc:DBF:/"+"D:/temp/upload";
String sql="select * from demo13";
Connection con = DriverManager.getConnection(url1, "", "");
Statement stmt1=con.createStatement();
ResultSet rs=stmt1.executeQuery(sql);
stmt1.close();
con.close();
rs.close();
PrintWriter out = response.getWriter();
out.println("<html>"); out.println("<head><title>dbftest</title></head>"); out.println("<body>"); out.println("<p>The servlet has received a GET. This is thereply.</p>");
out.println("</body></html>");
}
catch (Exception e){
throw new ServletException(e);
}
Regards,
Shahzad Received on Mon May 13 2002 - 07:54:03 CDT
![]() |
![]() |