1 28 29 package com.caucho.db.sql; 30 31 import com.caucho.db.Database; 32 import com.caucho.db.store.Transaction; 33 import com.caucho.db.table.TableFactory; 34 import com.caucho.log.Log; 35 import com.caucho.sql.SQLExceptionWrapper; 36 37 import java.sql.SQLException ; 38 import java.util.logging.Logger ; 39 40 public class CreateQuery extends Query { 41 private static final Logger log = Log.open(CreateQuery.class); 42 43 private TableFactory _factory; 44 45 CreateQuery(Database db, String sql, TableFactory factory) 46 throws SQLException 47 { 48 super(db, sql, null); 49 50 _factory = factory; 51 } 52 53 56 public TableFactory getFactory() 57 { 58 return _factory; 59 } 60 61 64 public void execute(QueryContext queryContext, Transaction xa) 65 throws SQLException 66 { 67 try { 68 _factory.create(); 69 } catch (java.io.IOException e) { 70 throw new SQLExceptionWrapper(e); 71 } 72 73 queryContext.setRowUpdateCount(0); 74 } 75 76 public String toString() 77 { 78 return "CreateQuery[]"; 79 } 80 } 81 | Popular Tags |