db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorbjørn Ravn Andersen <thunderax...@gmail.com>
Subject [Howto?] Creating a new Derby database with ddlutils.
Date Mon, 07 Nov 2005 10:47:20 GMT
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

Mime
View raw message