public static Connection createSpatialDataBase ( String dbName , boolean initSpatial , String h2Parameters ) throws SQLException , ClassNotFoundException { String databasePath = initDBFile ( dbName , h2Parameters ) ; org . h2 . Driver . load ( ) ; // Keep a connection alive to not close the DataBase on each unit test Connection connection = DriverManager . getConnection ( databasePath , "sa" , "sa" ) ; // Init spatial ext if ( initSpatial ) { H2GISFunctions . load ( connection ) ; } return connection ; }
Create a spatial database