afterJFinalStart() 添加一个线程

南客 发布于 2014/06/26 21:23
阅读 1K+
收藏 0

@JFinal 你好,想跟你请教个问题:波哥,afterJFinalStart()添加一个线程,

public void afterJFinalStart() {
Thread indexThread = new Thread(new Ser.Plan());
indexThread.start();


}

package Ser;


public class Plan extends Thread {
public void run() {
int i = 1;
//Model.Dev_Plan plan=new Model.Dev_Plan();

while (i == 1) {
try {
 System.out.println(Model.dao("SQL语句").size());
sleep(3000);
} catch (InterruptedException e) {

e.printStackTrace();
}
}
}
}



出现异常,不知道是什么原因

Exception in thread "Thread-25" com.jfinal.plugin.activerecord.ActiveRecordException: com.microsoft.sqlserver.jdbc.SQLServerException: 索引 1 超出范围。
at com.jfinal.plugin.activerecord.Model.find(Model.java:455)
at Model.Dev_Plan.list_preparation_produce(Dev_Plan.java:34)
at Ser.Plan.run(Plan.java:11)
at java.lang.Thread.run(Thread.java:619)
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: 索引 1 超出范围。
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:170)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.setterGetParam(SQLServerPreparedStatement.java:698)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.setObjectNoType(SQLServerPreparedStatement.java:894)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.setObject(SQLServerPreparedStatement.java:919)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.setObject(NewProxyPreparedStatement.java:365)
at com.jfinal.plugin.activerecord.dialect.Dialect.fillStatement(Dialect.java:74)
at com.jfinal.plugin.activerecord.Model.find(Model.java:435)
at com.jfinal.plugin.activerecord.Model.find(Model.java:453)
... 3 more



加载中
1
南客
南客
哈哈,可以了呀!谢谢
0
JFinal
JFinal
sql 语句与 传的参数有错误
返回顶部
顶部