gpt4 book ai didi

java - net.ucanaccess.jdbc.UcanaccessSQLException:UCAExc:::4.0.4 意外标记:DAY

转载 作者:行者123 更新时间:2023-12-02 04:57:23 28 4
gpt4 key购买 nike

public void sqlData() throws ClassNotFoundException, SQLException
{

Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
Connection con = DriverManager.getConnection("jdbc:ucanaccess://path;
String qry = "SELECT Patient.NAME AS patient, Patient.DISEASE AS
disease FROM Patient, Doctor WHERE
Patient.DISEASE=Doctor.SPECIALIZATION";
try{

Statement st = con.createStatement();
ResultSet rs = st.executeQuery(qry);
DefaultTableModel model = (DefaultTableModel)appoint_table.getModel();
int x =1;
while(rs.next())
{
String rrr = rs.getString("patient");
System.out.println(rrr);

}
}
catch(SQLException e)
{
System.out.println(e);
}
}

最佳答案

您发布的代码不太可能抛出该异常,但我尝试回答,同时假设太多细节无法正确执行。无论如何...

<小时/>

我假设:

  1. 您正在使用 JPA
  2. 您设置了分隔标识符
  3. 您还使用 EclipseLink 作为实现。

如果是这样,请执行以下操作:

在 persistence.xml 中包含目标数据库条目:

    <property name="eclipselink.target-database" value="org.eclipse.persistence.platform.database.AccessPlatformDelimiterConfig"/>

将新类添加到类路径中:

package org.eclipse.persistence.platform.database;

public class AccessPlatformDelimiterConfig extends AccessPlatform {

private static final long serialVersionUID = 7034590043310425678L;

public AccessPlatformDelimiterConfig() {
super();
this.tableQualifier = "";
this.startDelimiter = "";
this.endDelimiter = "";
}
}

关于java - net.ucanaccess.jdbc.UcanaccessSQLException:UCAExc:::4.0.4 意外标记:DAY,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56404816/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com