1 21 22 package org.apache.derby.impl.tools.ij; 23 24 import java.sql.Connection ; 25 import java.sql.Statement ; 26 import java.sql.SQLException ; 27 29 class AsyncStatement extends Thread { 30 Connection conn; 31 String stmt; 32 ijResult result; 33 34 AsyncStatement(Connection theConn, String theStmt) { 35 conn = theConn; 36 stmt = theStmt; 37 } 38 39 public void run() { 40 Statement aStatement = null; 41 try { 42 aStatement = conn.createStatement(); 43 aStatement.execute(stmt); 44 result = new ijStatementResult(aStatement,true); 45 } catch (SQLException e) { 47 result = new ijExceptionResult(e); 48 if (aStatement!=null) 49 try { 50 aStatement.close(); 51 } catch (SQLException e2) { 52 } 54 } 55 aStatement = null; 56 } 57 58 ijResult getResult() { return result; } 59 } 60 | Popular Tags |