public static void initialize(final CDatabaseConfiguration configuration) throws CouldntLoadDriverException, CouldntConnectException, SQLException {
  checkDriver(configuration);
  final String url=POSTGRES_DRIVER + "//" + configuration.getHost()+ "/"+ POSTGRES_DEFAULT_DB;
  Connection connection=null;
  try {
    connection=DriverManager.getConnection(url,configuration.getUser(),configuration.getPassword());
  }
 catch (  final SQLException exception) {
    CUtilityFunctions.logException(exception);
    throw new CouldntConnectException(exception,exception.getErrorCode(),exception.getSQLState());
  }
  final String statement="CREATE DATABASE \"" + configuration.getName() + "\"";
  final PreparedStatement preparedStatement=connection.prepareStatement(statement);
  try {
    preparedStatement.execute();
  }
  finally {
    preparedStatement.close();
    connection.close();
  }
}

public static void initialize ( final CDatabaseConfiguration configuration ) throws CouldntLoadDriverException , CouldntConnectException , SQLException { checkDriver ( configuration ) ; final String url = POSTGRES_DRIVER + "//" + configuration . getHost ( ) + "/" + POSTGRES_DEFAULT_DB ; Connection connection = null ; try { connection = DriverManager . getConnection ( url , configuration . getUser ( ) , configuration . getPassword ( ) ) ; } catch ( final SQLException exception ) { CUtilityFunctions . logException ( exception ) ; throw new CouldntConnectException ( exception , exception . getErrorCode ( ) , exception . getSQLState ( ) ) ; } final String statement = "CREATE DATABASE \"" + configuration . getName ( ) + "\"" ; final PreparedStatement preparedStatement = connection . prepareStatement ( statement ) ; try { preparedStatement . execute ( ) ; } finally { preparedStatement . close ( ) ; connection . close ( ) ; } }
initializes a new postgresql database
