Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Maybe this <a href="http://static.springsource.org/spring/docs/3.1.x/spring-framework-reference/html/jdbc.html" rel="nofollow">tutorial</a> will help. BTW, there is one interesting Spring feature to fit your needs - embedded database support. So, I usually just use following construction to create in-memory H2 db, create schema with schema.sql and fill it with some data from test-data.sql:</p> <pre class="lang-xml prettyprint-override"><code>&lt;jdbc:embedded-database id="dataSource" type="H2"&gt; &lt;jdbc:script location="classpath:schema.sql"/&gt; &lt;jdbc:script location="classpath:test-data.sql"/&gt; &lt;/jdbc:embedded-database&gt; </code></pre> <p>Then you could use this bean as datasource for you EntityManagerFactory bean:</p> <pre class="lang-xml prettyprint-override"><code>&lt;bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" p:dataSource-ref="dataSource" p:persistence-xml-location="classpath:META-INF/persistence.xml"&gt; &lt;property name="jpaVendorAdapter"&gt; &lt;bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"&gt; &lt;property name="databasePlatform" value="org.hibernate.dialect.MySQLInnoDBDialect"/&gt; &lt;property name="showSql" value="true" /&gt; &lt;!-- other properties --&gt; &lt;/bean&gt; &lt;/property&gt; &lt;property name="persistenceUnitName" value="OpenPU" /&gt; &lt;/bean&gt; </code></pre> <p>This is very convenient and concise way to create in-memory database for tests with Spring. (don't forget to add H2 in your classpath) See <a href="http://static.springsource.org/spring/docs/3.1.x/spring-framework-reference/html/jdbc.html" rel="nofollow">documentation</a> for details, chapter "13.8 Embedded database support".</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload