1 4 5 package com.triactive.jdo; 6 7 import com.triactive.jdo.SchemaManager; 8 import com.triactive.jdo.SchemaManagerFactory; 9 import java.util.Properties ; 10 import javax.jdo.JDOHelper; 11 import javax.jdo.PersistenceManagerFactory; 12 13 14 21 22 public class DropJDOTables 23 { 24 27 28 private DropJDOTables() 29 { 30 } 31 32 33 38 39 public static void main(String [] args) 40 { 41 Properties props = new Properties (); 42 props.setProperty("javax.jdo.PersistenceManagerFactoryClass", 43 "com.triactive.jdo.PersistenceManagerFactoryImpl"); 44 props.setProperty("javax.jdo.option.ConnectionDriverName", DatabaseProperties.dbDriver); 45 props.setProperty("javax.jdo.option.ConnectionURL", DatabaseProperties.dbURL); 46 props.setProperty("javax.jdo.option.ConnectionUserName", DatabaseProperties.dbUser); 47 props.setProperty("javax.jdo.option.ConnectionPassword", DatabaseProperties.dbPassword); 48 49 PersistenceManagerFactory pmf = JDOHelper.getPersistenceManagerFactory(props); 50 51 SchemaManager schemaMgr = SchemaManagerFactory.getSchemaManager(pmf.getPersistenceManager()); 52 53 schemaMgr.dropAllTables(); 54 } 55 } 56 | Popular Tags |