Friday, 4 December 2015

Accessing H2 in memory database

Accessing H2 in memory database integrated in spring application

Add below 2 beans in spring config. H2 console will be accessible on http://localhost:8082/

<bean id="h2Server" class="org.h2.tools.Server" factory-method="createTcpServer" init-method="start" destroy-method="stop" depends-on="h2WebServer">
<constructor-arg value="-tcp,-tcpAllowOthers,-tcpPort,9092"/>
</bean>
<bean id="h2WebServer" class="org.h2.tools.Server" factory-method="createWebServer" init-method="start" destroy-method="stop">
<constructor-arg value="-web,-webAllowOthers,-webPort,8082"/>
</bean>

No comments:

Post a Comment