Click here to Skip to main content
15,889,116 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
I am trying to create a Database connection with MSAccess Database in JAVA. I am using JDK 8 & MSAccess 2010(.accdb).
this code worked on JDK7 but the error occurred after I upgrade the JDK8.
when i run my code its gives an error No suitable driver found for dbc:ucanaccess://D:/WebSite/DataInfo.accdb
My code is :
String errMsg="";
Connection connection=null;
        Statement statement=null;
        
        try {
        connection=DriverManager.getConnection("dbc:ucanaccess://D:/WebSite/Site Project/CollegProj/web/DataInfo.accdb","", ""); 
        statement=connection.createStatement();
} catch (Exception e)
                                             {
               out.println("Error : "+e.getMessage());
               
               } 
                         if(request.getParameter("nam")!=null)
                                                         {
                             String nam=request.getParameter("nam");
                             String pas=request.getParameter("pass");
ResultSet resultSet=statement.executeQuery("select * from LogDetails ");

I download all necessary JAR files
ucanaccess-2.0.9.jar
hsqldb.jar
jackcess-1.2.9.jar


How I connect the Access Database in JDK8?
and last thing I am using Windows 7 64bit(I thought this would help)..
Thanks in Advance..
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900