1 64 package com.jcorporate.expresso.services.test; 65 66 import com.jcorporate.expresso.core.db.DBException; 67 import com.jcorporate.expresso.core.dbobj.Schema; 68 import com.jcorporate.expresso.core.utility.DBTool; 69 import com.jcorporate.expresso.services.html.HtmlException; 70 71 import java.util.Vector ; 72 73 74 80 public class SchemaDeleter { 81 84 private static Vector theSchemas = null; 85 86 89 static String dataContext = null; 90 91 94 public SchemaDeleter() { 95 } 96 97 102 public void setDataContext(final String newValue) { 103 synchronized (SchemaDeleter.class) { 104 dataContext = newValue; 105 } 106 } 107 108 113 public String getDataContext() { 114 synchronized (SchemaDeleter.class) { 115 return dataContext; 116 } 117 } 118 119 124 public static void setSchemas(Vector v) { 125 synchronized (SchemaDeleter.class) { 126 theSchemas = v; 127 } 128 } 129 130 136 public static void deleteSchema(final String dbName, final Schema oneSchema) { 137 Vector v = new Vector (); 138 v.add(oneSchema); 139 140 try { 141 DBTool.deleteSchema(null, dbName, v); 142 } catch (DBException e) { 143 } catch (HtmlException he) { 144 } 145 } 146 147 153 public static void deleteSchemas(final String dbName) { 154 synchronized (SchemaDeleter.class) { 155 if (theSchemas != null) { 156 try { 159 DBTool.deleteSchema(null, dbName, theSchemas); 160 } catch (DBException e) { 161 } catch (HtmlException he) { 163 } 165 } 166 } 167 } 168 } 169 | Popular Tags |