Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i'm developing a system that will take the user input and safe it in access file as database for registration system


favorite
i'm developing a system that will take the user input and safe it in access file as database for registration system

Java
DBClass DB = new DBClass();
    DB.WrieToDatabase(jTextFieldID.getText(), jTextFieldname.getText(), jTextFieldemail.getText(), jPasswordFieldpass.getText(), jComboBoxgendar.getSelectedItem() +"" );


but when i run the code it gives the following error message:

java.sql.SQLException: No suitable driver found for jdbc:odbc:Driver=(Microsoft Access Driver (*.accdb)};DBQ=store.accdb;DriverID=22;READONLY=false} Error: Record could not be inserted into the database

What I have tried:

adding the access file path but i am not sure how to do it
Posted
Updated 17-Apr-18 23:49pm

1 solution

You are probably using a recent Java version. That does not include the JDBC-ODBC bridge anymore so that ODBC database drivers can't be used.

You have to use a JDBC driver instead. But the problem is that such is not provided by Microsoft for Access. So you have to use a commercial or open source driver instead (search the web for "jdbc access driver"). Because I have not used one so far, I can not recommend a specific one.

Alternatively use a different database.
 
Share this answer
 
Comments
Member 13725790 18-Apr-18 10:37am    
@Jochen Amdt so there’s no problem with the code but the access file im using right?
Jochen Arndt 18-Apr-18 10:46am    
It is a problem with the database driver. The code tries to use a driver that does not exist. In any case you have to change that code line to use an installed driver for the used database.
Member 13725790 18-Apr-18 11:09am    
Aha could you help me please how to change the driver? I’m sorry if I sound slow
Jochen Arndt 18-Apr-18 11:23am    
As described in my answer:
You either need to get and install a JDBC driver for access (google for "jdbc driver access") or use another database engine and get and install the JDBC driver for that. The advantage of the second option is that you get an official driver from the database engine publisher for nearly all database engines. But not for Access.
Member 13725790 18-Apr-18 11:53am    
Thank you so much i solved it I downloaded the JDBC driver it worked

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