1 27 28 29 package org.webdocwf.util.loader.test; 30 31 import java.sql.Connection ; 32 import java.sql.Statement ; 33 import org.webdocwf.util.loader.test.DatabaseOperation; 34 import org.webdocwf.util.loader.Loader; 35 import org.webdocwf.util.loader.LoaderException; 36 37 import java.sql.SQLException ; 38 39 45 public class DropDatabaseOperation extends DatabaseOperation 46 { 47 48 private String databaseName=null; 49 50 DropDatabaseOperation() 51 { 52 } 53 54 public DropDatabaseOperation(String name) 55 { 56 databaseName=name; 57 } 58 59 62 68 69 public void execute(Connection conn) throws SQLException 70 { 71 Statement stmt = conn.createStatement(); 72 73 if(databaseName!=null){ 74 try 75 { 76 stmt.execute("DROP DATABASE "+databaseName); 77 } 78 finally 79 { 80 stmt.close(); 81 } 82 } 83 84 } 85 86 87 91 public String getDatabaseOperationType() 92 { 93 return DatabaseOperation.DROP; 94 } 95 96 97 } 98 99 100 101 102 103 104 105 | Popular Tags |