gpt4 book ai didi

java - 运行程序时得到 0>=0

转载 作者:太空宇宙 更新时间:2023-11-04 10:56:23 25 4
gpt4 key购买 nike

我运行这段代码

public void loadtwo()
{
try{
String query="SELECT Grade.GradeName, [Group].GroupName, AcademicInfo.EntranceYear, Semester.SemesterName, AcademicRank.AcademicRankName, Others.OthersName, AcademicInfo.AcademicInfoID,AcademicInfo.Major, AcademicInfo.Department\n "+
"FROM AcademicInfo INNER JOIN\n" +
"AcademicRank ON AcademicInfo.AcademicRankID = AcademicRank.AcademicRankID INNER JOIN\n" +
"Grade ON AcademicInfo.GradeID = Grade.GradeID INNER JOIN\n" +
"[Group] ON AcademicInfo.GroupID = [Group].GroupID INNER JOIN\n" +
"Others ON AcademicInfo.OthersID = Others.OthersID INNER JOIN\n" +
"Semester ON AcademicInfo.SemesterID = Semester.SemesterID";
DBlabprj.rs=DBlabprj.stmt.executeQuery(query);
int i=0;
while(DBlabprj.rs.next())
{
edutbl.setValueAt(DBlabprj.rs.getString("GradeName"),i,0);
edutbl.setValueAt(DBlabprj.rs.getString("GroupName"),i,1);
edutbl.setValueAt(DBlabprj.rs.getInt("EntranceYear"),i,2);
edutbl.setValueAt(DBlabprj.rs.getString("SemesterName"),i,3);
edutbl.setValueAt(DBlabprj.rs.getString("AcademicRankName"),i,4);
edutbl.setValueAt(DBlabprj.rs.getString("OthersName"),i,5);
edutbl.setValueAt(DBlabprj.rs.getInt("AcademicInfoID"),i,6);
edutbl.setValueAt(DBlabprj.rs.getString("Major"),i,7);
edutbl.setValueAt(DBlabprj.rs.getString("Department"),i,8);

i++;
}
}
catch(Exception e)
{
JOptionPane.showMessageDialog(rootPane,e.getMessage());
}
}

我收到此错误:

0>=0

我不明白出了什么问题,当我从组中删除 [] 时,我收到此错误:

Incorrect Syntax near the word 'Group'

最佳答案

第二个错误是由于 group 是 T-SQL 的关键字,因此您可以尝试使用其他变量为表添加别名。

关于java - 运行程序时得到 0>=0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47304051/

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