I'm having problems with my Java program. I'm using MS Access as a database and UCanAccess to connect to the database.
When I'm trying to insert a text into the database, I get an Exception:
net.ucanaccess.jdbc.UcanaccessSQLException: integrity constraint violation: unique constraint or index violation; ENTRIES_PRIMARYKEY table: ENTRIES
This is the SQL statement, that results in the exception:
"INSERT INTO Entries (Text, Title, Date, Time) VALUES"
+ "(\"" + text + "\", \"" + title + "\", \"" + date + "\", \"" + time + "\");";
The primary keys of table Entries is (Title, Date). The information I'm inserting does not exist in the table.
I've made a System.out.println() containing the same string to make sure the variables contain the correct information, and they do.
Can someone tell me what I'm doing wrong?