I wrote code that will take the input from JtextFields when a button is pressed, which will then put the values into query language and supposedly will add them
Ive tried googling and changing code many times, all to no prevail
addadmin.addActionListener(ev -> {
String adminName = theAdminName.getText();
String adminlastname = theAdminlastname.getText();
String msAccDB = "C:/Users/joshu/Desktop/Linda Liu Database.accdb";
String dbURL = "jdbc:ucanaccess://" + msAccDB;
Connection connection;
Statement statement;
ResultSet resultSet;
try {
connection = DriverManager.getConnection(dbURL);
statement = connection.createStatement();
resultSet = statement.executeQuery("INSERT INTO (AdminName, AdminLastName) VALUES (" + adminName + ", " + adminlastname + ");");
} catch (SQLException e) {
e.printStackTrace();
}
});
I expect it to add the input from the buttons
exceptions java.sql.SQLException: No suitable driver found for jdbc:ucanaccess://C:/Users/joshu/Desktop/Linda Liu Database.accdb at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source)