Display HSQLDB database created by Spring MVC

0

How you can view the database created in memory by Spring MVC when using the code:

@Bean
public DataSource dataSource() {
    return new EmbeddedDatabaseBuilder()
            .setType(EmbeddedDatabaseType.HSQL)
            .generateUniqueName(true)
            .build();
}

You can view or manipulate this database with the HSQL Database Manager tool.

    
asked by nullptr 10.06.2017 в 17:50
source

1 answer

0

Yes you can. To see the database in memory can be done with the following line in the code. Put it somewhere in your application where that line runs (it can be in a test too).

When you go through that line, a window will open with an interface where you can see the database and execute sql sentences.

DatabaseManagerSwing.main(new String[] { "--url", "jdbc:hsqldb:mem:dataSource", "--user", "sa", "--password", "" });
    
answered by 12.06.2017 в 15:13