线程中断的问题
xywl 2007-06-13 01:26:11 想在execute sql时可以中断
------------------------------------
Thread th=new Thread(){
public void run(){
wait.getLb_Text().setText("Exquting,Please Wait!!!");
wait.setVisible(true);
wait.repaint();
try{
stmt=conn.createStatement(java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE ,java.sql.ResultSet.CONCUR_READ_ONLY );
rs=stmt.executeQuery(sql);
...............................
wait.setVisible(false);
wait.repaint();
}
catch(InterruptedException ex){
System.out.println("System interrupted");
}
}
};
wait.thread=th;
th.start();
-------------------------------------------------------------------
在相应的 try 语句主体中不能抛出异常 java.lang.InterruptedException
catch(InterruptedException ex){
1 错误