I want my ddlutils program to create a fresh database in Derby when
starting, but I cannot quite figure out how to do this correctly.
I understand that I need to use something similar to:
EmbeddedDataSource dataSource = new EmbeddedDataSource();
DataSource ds = dataSource;
Platform platform = PlatformFactory.createNewPlatformInstance(ds);
platform.createDatabase("org.apache.derby.jdbc.ClientDriver", dbURL,
"me", "mine", Collections.EMPTY_MAP);
System.out.print("Created");
but unfortunately the creation of the platform in order to get the
createDatabase method, results in a Derby connection being made, which
fails because there is no databases corresponding.
I therefore have a chicken and egg problem :(
Is there any particular reason that the createDatabase method isn't static?
--
Thorbjørn