自从 Java 1.8 中消除了 JDBC 桥(我们仍然感到悲痛)并迁移到 UcanAccess 以来,我一直在调试 SQL 代码,这些代码过去从未给我带来任何问题。其中一个语句是:
DELETE TreatmentRecords.DateGiven, TreatmentRecords.TimeGiven, SInformation.Surname, SInformation.FirstNames, TreatmentRecords.Diagnosis, TreatmentRecords.*
FROM SInformation INNER JOIN TreatmentRecords ON SInformation.SID = TreatmentRecords.SID
WHERE (((TreatmentRecords.DateGiven)=#2015-03-07#) AND ((TreatmentRecords.TimeGiven)='17;16') AND ((SInformation.Surname)='Doe') AND ((SInformation.FirstNames)='John') AND ((TreatmentRecords.Diagnosis)='Headache'));
在 Access 本身中执行时,我绝对没有错误或问题。但是 Ucancess 抛出以下异常:
net.ucanaccess.jdbc.UcanaccessSQLException: unexpected token: TREATMENTRECORDS required: FROM
任何关于为什么的想法将不胜感激!