Note that there are some explanatory texts on larger screens.

plurals
  1. POHSQLDB In-memory database JDBC Template Query failing
    primarykey
    data
    text
    <p>I have a unit test, that uses JDBCTemplate and an in-memory database. My HSQLDB Settings are :</p> <pre><code>jdbc.driver.className=org.hsqldb.jdbcDriver jdbc.url=jdbc\:hsqldb\:mem\:test;DB_CLOSE_DELAY\=-1 jdbc.username=sa jdbc.password= </code></pre> <p>I am creating a table and then trying to check if any data exists in it through JDBCTemplate before inserting a new record in it.</p> <p>I am invoking JDBC query through JDBCTemplate as below:</p> <pre><code>String query = "select id from Person where id=?"; int isExist = jdbcTemplate.update(query, "1"); </code></pre> <p>In my config xml, I have wired the dataSource as below:</p> <pre><code>&lt;bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" lazy-init="default" autowire="default"&gt; &lt;property name="driverClassName" value="${jdbc.driver.className}" /&gt; &lt;property name="url" value="${jdbc.url}" /&gt; &lt;property name="username" value="${jdbc.username}" /&gt; &lt;property name="password" value="${jdbc.password}" /&gt; &lt;/bean&gt; &lt;bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate"&gt; &lt;property name="dataSource" ref="dataSource"/&gt; &lt;/bean&gt; </code></pre> <p>I am getting an error that says : </p> <pre><code>org.hsqldb.HsqlException : statement does not generate a row count </code></pre> <p>The same code works if i remove in memory database and actually connect to an Oracle Database but for tests I need in memory database.</p> <p>Can you please help?</p> <p>Thanks</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.
 

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