How to use HSQLDB in Oracle query syntax mode?

拜拜、爱过 提交于 2019-11-28 10:52:38

This option was introduced with HSQLDB 2.0.

Are you sure you are using the correct version?
Maybe you have 1.8 still in the classpath somewhere.

But that won't get you far in terms of testing anyway, because this only turns on some basic syntax "replacing", there is no real behaviour change involved here (and I'm not even talking about more advanced Oracle features like analytical functions, CONNECT BY or something similar).

It is very seldom a good idea to test your application with a DBMS that will not be used in production. It is simply not a valid test.

borjab

Even if it only change some basic syntax here is an example of how you can do it:

<bean class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" id="dataSource">
    <property name="driverClassName" value="org.hsqldb.jdbcDriver" />
    <property name="url" value="jdbc:hsqldb:mem:PUBLIC;sql.syntax_ora=true" />
    <property name="username" value="sa" />
    <property name="password" value="" />
</bean>

The sql.syntax_ora=true URL property enables syntax compatibility, including the NUMBER type and the DUAL table. Additional properties can be used for more behavior compatibility. These are documented in the HSQLDB Guide:

http://hsqldb.org/doc/2.0/guide/compatibility-chapt.html#coc_compatibility_oracle

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!