Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> unable to connect to a DBF db under OAS using servlet

unable to connect to a DBF db under OAS using servlet

From: Shahzad Latif <shai_02_at_hotmail.com>
Date: 13 May 2002 05:54:03 -0700
Message-ID: <1f16721b.0205130454.69f52e4f@posting.google.com>


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 the
reply.</p>");

    out.println("</body></html>");
}

  catch (Exception e){

     throw new ServletException(e);
}

Regards,

Shahzad Received on Mon May 13 2002 - 07:54:03 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US