0

im new in java programming and new in this forum. currently im doing my project in jsp that have database connection using microsoft access. im trying to use ucanaccess driver for sql connection and that's where i got an error:java.sql.SQLException: No suitable driver found for jdbc:ucanaccess://C:/Users/dbaccess/testDB.accdb.

i'm using eclipse as an IDE for the project. i already put all 5 jars file to the reference library as mentioned by one of the user here in stackoverflow.

String dburl = "jdbc:ucanaccess://C:/Users/dbaccess/testDB.accdb";

 Connection con=DriverManager.getConnection(dburl,"","");
 Statement stmt=con.createStatement();
ResultSet rs=stmt.executeQuery("SELECT * FROM studTab");
boolean b=rs.next();

out.println("registration no: "+rs.getString(1));
 out.println("<br>name: "+rs.getString(2));
out.println("<table border=5>");
out.println("<th>"+"IT2353"+"</th>");

while(b)
{
    out.println("<tr>");
    out.println("<td>"+rs.getString(2)+"</td>");
    out.println("</tr>");
    b =rs.next();
}
out.println("</table>");

error: Type Exception Report

Message javax.servlet.ServletException: java.sql.SQLException: No suitable driver found for jdbc:ucanaccess://C:/Users/dbaccess/testDB.accdb

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception org.apache.jasper.JasperException: javax.servlet.ServletException: java.sql.SQLException: No suitable driver found for jdbc:ucanaccess://C:/Users/dbaccess/testDB.accdb org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:598) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:499) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330) javax.servlet.http.HttpServlet.service(HttpServlet.java:742) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

Root Cause javax.servlet.ServletException: java.sql.SQLException: No suitable driver found for jdbc:ucanaccess://C:/Users/dbaccess/testDB.accdb org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:909) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:838) org.apache.jsp.studInfo_jsp._jspService(studInfo_jsp.java:165) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:742) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:476) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330) javax.servlet.http.HttpServlet.service(HttpServlet.java:742) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

Root Cause java.sql.SQLException: No suitable driver found for jdbc:ucanaccess://C:/Users/dbaccess/testDB.accdb java.sql.DriverManager.getConnection(Unknown Source) java.sql.DriverManager.getConnection(Unknown Source) org.apache.jsp.studInfo_jsp._jspService(studInfo_jsp.java:131) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:742) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:476) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330) javax.servlet.http.HttpServlet.service(HttpServlet.java:742) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

  • 1
    Possible duplicate of [The infamous java.sql.SQLException: No suitable driver found](https://stackoverflow.com/questions/1911253/the-infamous-java-sql-sqlexception-no-suitable-driver-found) – Hovercraft Full Of Eels Dec 20 '18 at 02:08
  • i;ve tried to register the driver but still not working, i;ve added the jars but still not working – noobprogrammer Dec 20 '18 at 02:44
  • found the answer, i just copy all the 5 jars files to apachesoftwarefoundation/tomcat/lib/. problem solved after that. – noobprogrammer Dec 20 '18 at 02:51

0 Answers0