platform.setPassword( passwd );
platform.createTables( dbModel, true, true );
// Insert the seed data to database
DataToDatabaseSink sink = new DataToDatabaseSink( platform, dbModel );
DataReader reader = new DataReader();
reader.setModel( dbModel );
reader.setSink( sink );
InputStream seedDataStream = this.getClass().getClassLoader().getResourceAsStream( "photovault_seed_data.xml" );
try {
reader.parse( seedDataStream );
} catch (SAXException ex) {
ex.printStackTrace();
} catch (IOException ex) {
ex.printStackTrace();
}
if ( seedDataResource != null ) {
seedDataStream = this.getClass().getClassLoader().getResourceAsStream( seedDataResource );
try {
reader.parse( seedDataStream );
} catch (SAXException ex) {
ex.printStackTrace();
} catch (IOException ex) {
ex.printStackTrace();
}