gpt4 book ai didi

java - 为什么我收到 SQLSyntaxErrorException -遇到 ""?

转载 作者:行者123 更新时间:2023-12-01 17:40:10 24 4
gpt4 key购买 nike

这个方法一直抛出标题中的异常,我找不到原因,我已经通过连接创建了其他表,并且所有引用的表都已创建。我正在使用嵌入式JavaDB .

private void createEvidenceTable() throws SQLException
{
Statement evidenceTable = CONNECTION.createStatement();
evidenceTable.execute("CREATE TABLE evidence("+
"evidence_id INTEGER NOT NULL PRIMARY KEY,"+
"date_added VARCHAR(6) NOT NULL,"+
"evidence_dated VARCHAR(6) NOT NULL,"+
"evidence_file varchar(20),"+
"evidence_text VARCHAR(10),"+
"source_location_id INTEGER,"+
"source_person_id INTEGER,"+
"evidence_type VARCHAR(20),"+
"CONSTRAINT evidence__location_source FOREIGN KEY(source_location_id) REFERENCES location_source,"+
"CONSTRAINT evidence_person_source FOREIGN KEY(source_person_id) REFERENCES person_source,"+
"CONSTARINT evidence_evidence_type FOREIGN KEY(evidence_type) REFERENCES evidence_types)");

}

最佳答案

一个明确的问题是第三个约束子句拼写错误 (CONSTARINT iso CONSTRAINT)

关于java - 为什么我收到 SQLSyntaxErrorException -遇到 ""?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1816585/

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