FileDocCategorySizeDatePackage
CreateDatabase.javaAPI DocExample1184Fri Nov 29 10:52:56 GMT 2002com.mediamania

CreateDatabase

public class CreateDatabase extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidcreate()

    try {
        InputStream propertyStream = new FileInputStream("jdo.properties");
        Properties jdoproperties = new Properties();
        jdoproperties.load(propertyStream);
        jdoproperties.put("com.sun.jdori.option.ConnectionCreate", "true");
        PersistenceManagerFactory pmf =
            JDOHelper.getPersistenceManagerFactory(jdoproperties);
        PersistenceManager pm = pmf.getPersistenceManager();
        Transaction tx = pm.currentTransaction();
        tx.begin();
        tx.commit();
        pm.close();
    } catch(Exception e) {
        System.err.println("Exception creating the database");
        System.err.println(e);
        System.exit(-1);
    }
public static voidmain(java.lang.String[] args)

//    CreateDatabase createDB = new CreateDatabase();
//    createDB.create();
    create();