for(int j=0; j<artifactCount; j++)
{
String first = r2.getString("context");
for(int k=0; k<relevantCount; k++)
{
String second = r4.getString("context");
System.out.println(first + " " + second);
r4.next();
}
r2.next();
}
您好所有, 我想一個coloumn的每個詞與其他coloumn條目匹配,但首先,我想遍歷使用嵌套的for循環的結果的結果集。在第一次迭代中,結果是正確的,因爲將會有單個單詞和一組單獨的單詞。下面給出的是第一次迭代的示例輸出,它是正確的。遍歷Java中使用嵌套的for循環
Technology Products
Technology Methodology
Technology Project management
Technology Risk
Technology Management
Technology Processes
Technology Capitalism
Technology Supply chain
Technology Skill
Technology Production and manufacturing
但在第二次迭代中,它給出了以下錯誤,因爲它沒有遍歷所有可能值的第二個值。
java.sql.SQLException: After end of result set
at com.mysql.jdbc.ResultSet.checkRowPos(ResultSet.java:4353)
at com.mysql.jdbc.ResultSet.getStringInternal(ResultSet.java:2137)
at com.mysql.jdbc.ResultSet.getString(ResultSet.java:2132)
at com.mysql.jdbc.ResultSet.getString(ResultSet.java:2250)
at WebArtifactListener$2.run(WebArtifactListener.java:166)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
您的幫助,將不勝感激...感謝名單