以下是我的代码的一部分。我一直在为我的数据库部分收到错误。我看了他们多个地方,似乎无法找到答案。有什么建议?代码和打印错误的内容如下所示!
ui-gmap-windows
以下是不断出现的错误:
public void deleteEmployee()
{
String sqlQuery;
sqlQuery = "DELETE FROM JAVAUSER.EMPLOYEE";
System.out.println(sqlQuery);
sendDBCommand(sqlQuery);
}
public void deleteAccident()
{
String sqlQuery;
sqlQuery = "DELETE FROM JAVAUSER.ACCIDENT";
System.out.println(sqlQuery);
sendDBCommand(sqlQuery);
}
public void deleteTruck()
{
String sqlQuery;
sqlQuery = "DELETE FROM JAVAUSER.TRUCK";
System.out.println(sqlQuery);
sendDBCommand(sqlQuery);
}
public void deleteHomeState()
{
String sqlQuery;
sqlQuery = "DELETE FROM JAVAUSER.HOMESTATE";
System.out.println(sqlQuery);
sendDBCommand(sqlQuery);
}
public void deleteCountry()
{
String sqlQuery;
sqlQuery = "DELETE FROM JAVAUSER.COUNTRY";
System.out.println(sqlQuery);
sendDBCommand(sqlQuery);
}
此外,当我的程序按下“插入按钮”时,我会按顺序调用所有删除方法
如何摆脱这些错误消息?
这是我的sendDBCommand:
run:
DELETE FROM JAVAUSER.HOMESTATE
java.sql.SQLException: ORA-01002: fetch out of sequence
DELETE FROM JAVAUSER.COUNTRY
java.sql.SQLException: ORA-01002: fetch out of sequence
DELETE FROM JAVAUSER.TRUCK
java.sql.SQLException: ORA-01002: fetch out of sequence
DELETE FROM JAVAUSER.ACCIDENT
java.sql.SQLException: ORA-01002: fetch out of sequence
DELETE FROM JAVAUSER.EMPLOYEE
java.sql.SQLException: ORA-01002: fetch out of sequence
答案 0 :(得分:0)
你应该包括一个计数器并打印结果,所以也许你应该有一个线索,同样,删除没有结果集,它应该是executeUpdate。