Upgrade to Tomcat 8.5.11
This commit is contained in:
@@ -0,0 +1 @@
|
||||
drop table T_TEST;
|
||||
@@ -0,0 +1 @@
|
||||
create table T_TEST (NAME varchar(50) not null);
|
||||
@@ -0,0 +1,3 @@
|
||||
drop table T_TEST if exists;
|
||||
|
||||
create table T_TEST (NAME varchar(50) not null);
|
||||
@@ -0,0 +1,2 @@
|
||||
insert into T_TEST (NAME) values ('Keith')@@
|
||||
insert into T_TEST (NAME) values ('Dave')@@
|
||||
@@ -0,0 +1 @@
|
||||
insert into T_TEST (NAME) values ('Keith');
|
||||
@@ -0,0 +1 @@
|
||||
update T_TEST set NAME='Dave' where name='Keith';
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-4.3.xsd">
|
||||
|
||||
<jdbc:embedded-database id="dataSource" type="HSQL" separator="@@">
|
||||
<jdbc:script location="classpath:org/springframework/jdbc/config/db-schema.sql" separator=";"/>
|
||||
<jdbc:script location="classpath:org/springframework/jdbc/config/db-test-data-endings.sql"/>
|
||||
</jdbc:embedded-database>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-4.2.xsd">
|
||||
|
||||
<jdbc:embedded-database>
|
||||
<jdbc:script location="classpath:org/springframework/jdbc/config/db-schema.sql" />
|
||||
<jdbc:script location="classpath:org/springframework/jdbc/config/db-test-data.sql" />
|
||||
</jdbc:embedded-database>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans:beans xmlns:beans="http://www.springframework.org/schema/beans" xmlns="http://www.springframework.org/schema/jdbc"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-4.2.xsd">
|
||||
|
||||
<embedded-database id="dataSource" database-name="customDbName">
|
||||
<script location="classpath:org/springframework/jdbc/config/db-schema.sql" />
|
||||
<script location="classpath:org/springframework/jdbc/config/db-test-data.sql" />
|
||||
</embedded-database>
|
||||
|
||||
</beans:beans>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans:beans xmlns:beans="http://www.springframework.org/schema/beans" xmlns="http://www.springframework.org/schema/jdbc"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-4.2.xsd">
|
||||
|
||||
<embedded-database id="dataSource" database-name="shouldBeOverriddenByGeneratedName" generate-name="true">
|
||||
<script location="classpath:org/springframework/jdbc/config/db-schema.sql" />
|
||||
<script location="classpath:org/springframework/jdbc/config/db-test-data.sql" />
|
||||
</embedded-database>
|
||||
|
||||
</beans:beans>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans:beans xmlns:beans="http://www.springframework.org/schema/beans" xmlns="http://www.springframework.org/schema/jdbc"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-4.2.xsd">
|
||||
|
||||
<embedded-database id="dataSource">
|
||||
<script location="classpath:org/springframework/jdbc/config/db-schema.sql" />
|
||||
<script location="classpath:org/springframework/jdbc/config/db-test-data.sql" />
|
||||
</embedded-database>
|
||||
|
||||
</beans:beans>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
|
||||
|
||||
<jdbc:embedded-database id="firstDataSource" />
|
||||
<jdbc:embedded-database id="secondDataSource" />
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd">
|
||||
|
||||
<jdbc:embedded-database id="dataSource" type="HSQL">
|
||||
<jdbc:script location="classpath:org/springframework/jdbc/config/db-schema.sql"/>
|
||||
<jdbc:script location="classpath*:org/springframework/jdbc/config/*-data.sql"/>
|
||||
</jdbc:embedded-database>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-4.2.xsd">
|
||||
|
||||
<jdbc:embedded-database id="dataSource" type="HSQL">
|
||||
<jdbc:script location="classpath:org/springframework/jdbc/config/db-schema.sql" />
|
||||
<jdbc:script location="classpath:org/springframework/jdbc/config/db-test-data.sql" />
|
||||
</jdbc:embedded-database>
|
||||
|
||||
<jdbc:embedded-database id="h2DataSource" type="H2">
|
||||
<jdbc:script location="classpath:org/springframework/jdbc/config/db-schema.sql" />
|
||||
<jdbc:script location="classpath:org/springframework/jdbc/config/db-test-data.sql" />
|
||||
</jdbc:embedded-database>
|
||||
|
||||
<jdbc:embedded-database id="derbyDataSource" type="DERBY">
|
||||
<jdbc:script location="classpath:org/springframework/jdbc/config/db-schema-derby.sql" />
|
||||
<jdbc:script location="classpath:org/springframework/jdbc/config/db-test-data.sql" />
|
||||
</jdbc:embedded-database>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd">
|
||||
|
||||
<jdbc:embedded-database id="dataSource" type="HSQL"/>
|
||||
|
||||
<jdbc:initialize-database data-source="dataSource">
|
||||
<jdbc:script location="classpath:org/springframework/jdbc/config/db-schema.sql" execution="INIT"/>
|
||||
<jdbc:script location="classpath:org/springframework/jdbc/config/db-test-data.sql" execution="INIT"/>
|
||||
<jdbc:script location="classpath:org/springframework/jdbc/config/db-drops.sql" execution="DESTROY"/>
|
||||
</jdbc:initialize-database>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd">
|
||||
|
||||
<jdbc:embedded-database id="dataSource" type="H2">
|
||||
<jdbc:script location="classpath:org/springframework/jdbc/config/db-schema.sql" execution="INIT"/>
|
||||
<jdbc:script location="classpath:org/springframework/jdbc/config/db-test-data.sql" execution="INIT"/>
|
||||
<jdbc:script location="classpath:org/springframework/jdbc/config/db-drops.sql" execution="DESTROY"/>
|
||||
</jdbc:embedded-database>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd">
|
||||
|
||||
<jdbc:embedded-database id="dataSource" type="HSQL">
|
||||
<jdbc:script location="classpath:org/springframework/jdbc/config/db-schema.sql" execution="INIT"/>
|
||||
<jdbc:script location="classpath:org/springframework/jdbc/config/db-test-data.sql" execution="INIT"/>
|
||||
<jdbc:script location="classpath:org/springframework/jdbc/config/db-drops.sql" execution="DESTROY"/>
|
||||
</jdbc:embedded-database>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd">
|
||||
|
||||
<jdbc:embedded-database id="dataSource" type="HSQL"/>
|
||||
|
||||
<jdbc:initialize-database data-source="dataSource">
|
||||
<jdbc:script location="classpath:org/springframework/jdbc/config/db-schema.sql"/>
|
||||
<jdbc:script location="classpath:org/springframework/jdbc/config/db-test-data.sql"/>
|
||||
</jdbc:initialize-database>
|
||||
|
||||
<!-- This cache relies on data created in the initialize-database element. It works fine
|
||||
if the bean definitions are registered in the right order. (Could possibly be fixed later.) -->
|
||||
<bean class="org.springframework.jdbc.config.InitializeDatabaseIntegrationTests$CacheData">
|
||||
<property name="dataSource" ref="dataSource"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd">
|
||||
|
||||
<jdbc:embedded-database id="dataSource" type="HSQL"/>
|
||||
|
||||
<jdbc:initialize-database data-source="dataSource" enabled="#{systemProperties['ENABLED']}">
|
||||
<jdbc:script location="classpath:org/springframework/jdbc/config/db-schema.sql"/>
|
||||
<jdbc:script location="classpath:org/springframework/jdbc/config/db-test-data.sql"/>
|
||||
</jdbc:initialize-database>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-4.3.xsd">
|
||||
|
||||
<jdbc:embedded-database id="dataSource" type="HSQL"/>
|
||||
|
||||
<jdbc:initialize-database data-source="dataSource" separator="@@">
|
||||
<jdbc:script location="classpath:org/springframework/jdbc/config/db-schema.sql" separator=";" encoding="ISO-8859-1"/>
|
||||
<jdbc:script location="classpath:org/springframework/jdbc/config/db-test-data-endings.sql"/>
|
||||
</jdbc:initialize-database>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd">
|
||||
|
||||
<jdbc:embedded-database id="dataSource" type="HSQL"/>
|
||||
|
||||
<jdbc:initialize-database data-source="dataSource">
|
||||
<jdbc:script location="classpath:org/springframework/jdbc/config/db-schema.sql" encoding="ISO-8859-1"/>
|
||||
<jdbc:script location="classpath:org/springframework/jdbc/config/db-test-data-endings.sql" separator="@@"/>
|
||||
</jdbc:initialize-database>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd">
|
||||
|
||||
<jdbc:embedded-database id="dataSource" type="HSQL">
|
||||
<jdbc:script location="classpath:org/springframework/jdbc/config/db-schema.sql" encoding="ISO-8859-1"/>
|
||||
<jdbc:script location="classpath:org/springframework/jdbc/config/db-test-data-endings.sql" separator="@@"/>
|
||||
</jdbc:embedded-database>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd">
|
||||
|
||||
<jdbc:embedded-database id="dataSource" type="HSQL" />
|
||||
|
||||
<jdbc:initialize-database data-source="dataSource" enabled="#{properties['data.source.init']}">
|
||||
<jdbc:script location="#{properties['schema.scripts']}" />
|
||||
<jdbc:script location="#{properties['insert.scripts']}" />
|
||||
</jdbc:initialize-database>
|
||||
|
||||
<util:properties id="properties">
|
||||
<prop key="schema.scripts">classpath:org/springframework/jdbc/config/db-schema.sql</prop>
|
||||
<prop key="insert.scripts">classpath*:org/springframework/jdbc/config/*-data.sql</prop>
|
||||
<prop key="data.source.init">true</prop>
|
||||
</util:properties>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd">
|
||||
|
||||
<jdbc:embedded-database id="dataSource" type="HSQL"/>
|
||||
|
||||
<jdbc:initialize-database data-source="dataSource" ignore-failures="DROPS">
|
||||
<jdbc:script location="classpath:org/springframework/jdbc/config/db-drops.sql"/>
|
||||
<jdbc:script location="classpath:org/springframework/jdbc/config/db-schema.sql"/>
|
||||
<jdbc:script location="classpath:org/springframework/jdbc/config/db-test-data.sql"/>
|
||||
</jdbc:initialize-database>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd">
|
||||
|
||||
<jdbc:embedded-database id="dataSource" type="HSQL"/>
|
||||
|
||||
<jdbc:initialize-database data-source="dataSource">
|
||||
<jdbc:script location="classpath:org/springframework/jdbc/config/db-schema.sql"/>
|
||||
<jdbc:script location="classpath*:org/springframework/jdbc/config/*-data.sql"/>
|
||||
</jdbc:initialize-database>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd">
|
||||
|
||||
<jdbc:embedded-database id="dataSource" type="HSQL" />
|
||||
|
||||
<jdbc:initialize-database data-source="dataSource" enabled="${data.source.init}">
|
||||
<jdbc:script location="${schema.scripts}" />
|
||||
<jdbc:script location="${insert.scripts}" />
|
||||
</jdbc:initialize-database>
|
||||
|
||||
<bean
|
||||
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
||||
<property name="properties">
|
||||
<value>
|
||||
schema.scripts=classpath:org/springframework/jdbc/config/db-schema.sql
|
||||
insert.scripts=classpath*:org/springframework/jdbc/config/*-data.sql
|
||||
data.source.init=true
|
||||
</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,9 @@
|
||||
{*
|
||||
these are custom block comments
|
||||
*}
|
||||
drop table T_TEST if exists;
|
||||
|
||||
{*
|
||||
these are custom block comments
|
||||
*}
|
||||
create table T_TEST (NAME varchar(50) not null);
|
||||
@@ -0,0 +1,5 @@
|
||||
-- Failed DROP can be ignored if necessary
|
||||
drop table T_TEST if exists;
|
||||
|
||||
-- Create the test table
|
||||
create table T_TEST (NAME varchar(50) not null);
|
||||
@@ -0,0 +1,5 @@
|
||||
~ Failed DROP can be ignored if necessary
|
||||
drop table T_TEST if exists;
|
||||
|
||||
~ Create the test table
|
||||
create table T_TEST (NAME varchar(50) not null);
|
||||
@@ -0,0 +1,3 @@
|
||||
drop table T_TEST;
|
||||
|
||||
create table T_TEST (NAME varchar(50) not null);
|
||||
@@ -0,0 +1,5 @@
|
||||
-- Failed DROP can be ignored if necessary
|
||||
drop table T_TEST;
|
||||
|
||||
-- Create the test table
|
||||
create table T_TEST (NAME varchar(50) not null);
|
||||
@@ -0,0 +1 @@
|
||||
create table T_TEST (NAME varchar(50) not null);
|
||||
@@ -0,0 +1,3 @@
|
||||
drop table T_TEST if exists;
|
||||
|
||||
create table T_TEST (NAME varchar(50) not null);
|
||||
@@ -0,0 +1 @@
|
||||
insert into T_TEST (NAME) values ('Keith');
|
||||
@@ -0,0 +1,5 @@
|
||||
-- Failed DROP can be ignored if necessary
|
||||
drop table T_TEST;
|
||||
|
||||
-- Create the test table
|
||||
create table T_TEST (NAME varchar(50) not null);
|
||||
@@ -0,0 +1,3 @@
|
||||
drop table T_TEST if exists;
|
||||
|
||||
create table T_TEST (NAME varchar(50) not null);
|
||||
@@ -0,0 +1,2 @@
|
||||
insert into T_TEST (NAME) values ('Keith')@@
|
||||
insert into T_TEST (NAME) values ('Dave')@@
|
||||
@@ -0,0 +1 @@
|
||||
insert into T_TEST (NAME) values ('''Keith''');
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,5 @@
|
||||
insert into T_TEST (NAME)
|
||||
values ('Keith')
|
||||
|
||||
insert into T_TEST (NAME)
|
||||
values ('Dave')
|
||||
@@ -0,0 +1,2 @@
|
||||
insert into T_TEST (NAME) values ('Keith');
|
||||
insert into T_TEST (NAME) values ('Dave');
|
||||
@@ -0,0 +1 @@
|
||||
insert into T_TEST (NAME) values ('\$Keith\$');
|
||||
@@ -0,0 +1,2 @@
|
||||
insert into T_TEST (NAME) values ('Keith')
|
||||
insert into T_TEST (NAME) values ('Dave')
|
||||
@@ -0,0 +1,3 @@
|
||||
insert into T_TEST (NAME) values ('Keith');
|
||||
insert into T_TEST (NAME) values ('Dave');
|
||||
select NAME from T_TEST where NAME = 'Keith';
|
||||
@@ -0,0 +1,5 @@
|
||||
insert into T_TEST (NAME) values ('Keith')
|
||||
/
|
||||
|
||||
insert into T_TEST (NAME) values ('Dave')
|
||||
/
|
||||
@@ -0,0 +1 @@
|
||||
insert into T_TEST (NAME) values ('Keith');
|
||||
@@ -0,0 +1 @@
|
||||
DROP TABLE users IF EXISTS
|
||||
@@ -0,0 +1,9 @@
|
||||
-- The next comment line starts with a tab.
|
||||
-- x, y, z...
|
||||
|
||||
insert into customer (id, name)
|
||||
values (1, 'Sam Brannen');
|
||||
-- This is also a comment with a leading tab.
|
||||
insert into orders(id, order_date, customer_id) values (1, '2013-06-08', 1);
|
||||
-- This is also a comment with a leading tab, a space, and a tab.
|
||||
insert into orders(id, order_date, customer_id) values (2, '2013-06-08', 1);
|
||||
@@ -0,0 +1,16 @@
|
||||
-- The next comment line has no text after the '--' prefix.
|
||||
--
|
||||
-- The next comment line starts with a space.
|
||||
-- x, y, z...
|
||||
|
||||
insert into customer (id, name)
|
||||
values (1, 'Rod; Johnson'), (2, 'Adrian Collier');
|
||||
-- This is also a comment.
|
||||
insert into orders(id, order_date, customer_id)
|
||||
values (1, '2008-01-02', 2);
|
||||
insert into orders(id, order_date, customer_id) values (1, '2008-01-02', 2);
|
||||
INSERT INTO persons( person_id--
|
||||
, name)
|
||||
VALUES( 1 -- person_id
|
||||
, 'Name' --name
|
||||
);--
|
||||
@@ -0,0 +1,17 @@
|
||||
/* This is a multi line comment
|
||||
* The next comment line has no text
|
||||
|
||||
* The next comment line starts with a space.
|
||||
* x, y, z...
|
||||
*/
|
||||
|
||||
INSERT INTO users(first_name, last_name) VALUES('Juergen', 'Hoeller');
|
||||
-- This is also a comment.
|
||||
/*
|
||||
* Let's add another comment
|
||||
* that covers multiple lines
|
||||
*/INSERT INTO
|
||||
users(first_name, last_name)
|
||||
VALUES( 'Sam' -- first_name
|
||||
, 'Brannen' -- last_name
|
||||
);--
|
||||
@@ -0,0 +1,12 @@
|
||||
-- The next comment line has no text after the '--' prefix.
|
||||
--
|
||||
-- The next comment line starts with a space.
|
||||
-- x, y, z...
|
||||
|
||||
INSERT INTO users(first_name, last_name) VALUES('Juergen', 'Hoeller');
|
||||
-- This is also a comment.
|
||||
INSERT INTO
|
||||
users(first_name, last_name)
|
||||
VALUES( 'Sam' -- first_name
|
||||
, 'Brannen' -- last_name
|
||||
);--
|
||||
@@ -0,0 +1,7 @@
|
||||
INSERT INTO users(first_name, last_name) VALUES('Juergen', 'Hoeller');
|
||||
|
||||
-- The following is not actually used; we just want to ensure that it does not
|
||||
-- result in a parsing exception due to the nested single quote.
|
||||
SELECT last_name AS "Juergen's Last Name" FROM users WHERE last_name='Hoeller';
|
||||
|
||||
INSERT INTO users(first_name, last_name) values('Sam', 'Brannen');
|
||||
@@ -0,0 +1,3 @@
|
||||
INSERT INTO
|
||||
users(first_name, last_name)
|
||||
values('Sam', 'Brannen')
|
||||
@@ -0,0 +1,3 @@
|
||||
INSERT INTO
|
||||
users(first_name, last_name)
|
||||
values('Sam', 'Brannen');
|
||||
@@ -0,0 +1,5 @@
|
||||
CREATE TABLE users (
|
||||
id INTEGER NOT NULL IDENTITY,
|
||||
first_name VARCHAR(50) NOT NULL,
|
||||
last_name VARCHAR(50) NOT NULL
|
||||
)
|
||||
@@ -0,0 +1,7 @@
|
||||
DROP TABLE users IF EXISTS;
|
||||
|
||||
CREATE TABLE users (
|
||||
id INTEGER NOT NULL IDENTITY,
|
||||
first_name VARCHAR(50) NOT NULL,
|
||||
last_name VARCHAR(50) NOT NULL
|
||||
);
|
||||
@@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:util="http://www.springframework.org/schema/util"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
|
||||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">
|
||||
|
||||
<bean id="dataSource" class="org.springframework.jdbc.datasource.TestDataSourceWrapper"/>
|
||||
|
||||
<bean id="queryWithPlaceholders" class="org.springframework.jdbc.object.GenericSqlQuery">
|
||||
<property name="dataSource" ref="dataSource"/>
|
||||
<property name="sql" value="select id, forename from custmr where id = ? and country = ?"/>
|
||||
<property name="parameters">
|
||||
<list>
|
||||
<bean class="org.springframework.jdbc.core.SqlParameter">
|
||||
<constructor-arg index="0" value="amount"/>
|
||||
<constructor-arg index="1">
|
||||
<util:constant static-field="java.sql.Types.INTEGER"/>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
<bean class="org.springframework.jdbc.core.SqlParameter">
|
||||
<constructor-arg index="0" value="custid"/>
|
||||
<constructor-arg index="1">
|
||||
<util:constant static-field="java.sql.Types.VARCHAR"/>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
</list>
|
||||
</property>
|
||||
<property name="rowMapperClass" value="org.springframework.jdbc.object.CustomerMapper"/>
|
||||
</bean>
|
||||
|
||||
<bean id="queryWithNamedParameters" class="org.springframework.jdbc.object.GenericSqlQuery">
|
||||
<property name="dataSource" ref="dataSource"/>
|
||||
<property name="sql" value="select id, forename from custmr where id = :id and country = :country"/>
|
||||
<property name="parameters">
|
||||
<list>
|
||||
<bean class="org.springframework.jdbc.core.SqlParameter">
|
||||
<constructor-arg index="0" value="id"/>
|
||||
<constructor-arg index="1">
|
||||
<util:constant static-field="java.sql.Types.INTEGER"/>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
<bean class="org.springframework.jdbc.core.SqlParameter">
|
||||
<constructor-arg index="0" value="country"/>
|
||||
<constructor-arg index="1">
|
||||
<util:constant static-field="java.sql.Types.VARCHAR"/>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
</list>
|
||||
</property>
|
||||
<property name="rowMapperClass" value="org.springframework.jdbc.object.CustomerMapper"/>
|
||||
</bean>
|
||||
|
||||
<bean id="queryWithRowMapperBean" class="org.springframework.jdbc.object.GenericSqlQuery">
|
||||
<property name="dataSource" ref="dataSource"/>
|
||||
<property name="sql" value="select id, forename from custmr where id = :id and country = :country"/>
|
||||
<property name="parameters">
|
||||
<list>
|
||||
<bean class="org.springframework.jdbc.core.SqlParameter">
|
||||
<constructor-arg index="0" value="id"/>
|
||||
<constructor-arg index="1">
|
||||
<util:constant static-field="java.sql.Types.INTEGER"/>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
<bean class="org.springframework.jdbc.core.SqlParameter">
|
||||
<constructor-arg index="0" value="country"/>
|
||||
<constructor-arg index="1">
|
||||
<util:constant static-field="java.sql.Types.VARCHAR"/>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
</list>
|
||||
</property>
|
||||
<property name="rowMapper">
|
||||
<bean class="org.springframework.jdbc.object.CustomerMapper"/>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:util="http://www.springframework.org/schema/util"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
|
||||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">
|
||||
|
||||
<bean id="dataSource" class="org.springframework.jdbc.datasource.TestDataSourceWrapper"/>
|
||||
|
||||
<bean id="genericProcedure" class="org.springframework.jdbc.object.GenericStoredProcedure">
|
||||
<property name="dataSource" ref="dataSource"/>
|
||||
<property name="sql" value="add_invoice"/>
|
||||
<property name="parameters">
|
||||
<list>
|
||||
<bean class="org.springframework.jdbc.core.SqlParameter">
|
||||
<constructor-arg index="0" value="amount"/>
|
||||
<constructor-arg index="1">
|
||||
<util:constant static-field="java.sql.Types.INTEGER"/>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
<bean class="org.springframework.jdbc.core.SqlParameter">
|
||||
<constructor-arg index="0" value="custid"/>
|
||||
<constructor-arg index="1">
|
||||
<util:constant static-field="java.sql.Types.INTEGER"/>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
<bean class="org.springframework.jdbc.core.SqlOutParameter">
|
||||
<constructor-arg index="0" value="newid"/>
|
||||
<constructor-arg index="1">
|
||||
<util:constant static-field="java.sql.Types.INTEGER"/>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
|
||||
|
||||
<beans>
|
||||
|
||||
<!--
|
||||
Whacky error codes for testing
|
||||
-->
|
||||
<bean id="Oracle" class="org.springframework.jdbc.support.SQLErrorCodes">
|
||||
<property name="badSqlGrammarCodes"><value>1,2</value></property>
|
||||
<property name="dataIntegrityViolationCodes"><value>1,1400,1722</value></property>
|
||||
<property name="customTranslations">
|
||||
<list>
|
||||
<bean class="org.springframework.jdbc.support.CustomSQLErrorCodesTranslation">
|
||||
<property name="errorCodes"><value>999</value></property>
|
||||
<property name="exceptionClass">
|
||||
<value>org.springframework.jdbc.support.CustomErrorCodeException</value>
|
||||
</property>
|
||||
</bean>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd">
|
||||
|
||||
<jdbc:embedded-database id="dataSource" type="H2"/>
|
||||
|
||||
<bean class="org.springframework.jdbc.support.CustomSQLExceptionTranslatorRegistrar">
|
||||
<property name="translators">
|
||||
<map>
|
||||
<entry key="H2">
|
||||
<bean class="org.springframework.jdbc.support.CustomSqlExceptionTranslator"/>
|
||||
</entry>
|
||||
</map>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
|
||||
|
||||
<beans>
|
||||
|
||||
<!--
|
||||
Whacky error codes for testing
|
||||
-->
|
||||
<bean id="Oracle" class="org.springframework.jdbc.support.SQLErrorCodes">
|
||||
<property name="badSqlGrammarCodes"><value>1,2</value></property>
|
||||
<property name="dataIntegrityViolationCodes"><value>1,1400,1722</value></property>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
|
||||
|
||||
<beans>
|
||||
|
||||
<!--
|
||||
Whacky error codes for testing
|
||||
-->
|
||||
<bean id="Oracle" class="org.springframework.jdbc.support.SQLErrorCodes">
|
||||
<property name="badSqlGrammarCodes"><value>1,2,942</value></property>
|
||||
<property name="dataIntegrityViolationCodes"><value>1,1400,1722</value></property>
|
||||
</bean>
|
||||
|
||||
<bean id="DB0" class="org.springframework.jdbc.support.SQLErrorCodes">
|
||||
<property name="databaseProductName"><value>*DB0</value></property>
|
||||
<property name="badSqlGrammarCodes"><value>-204,1,2</value></property>
|
||||
<property name="dataIntegrityViolationCodes"><value>3,4</value></property>
|
||||
</bean>
|
||||
|
||||
<bean id="DB1" class="org.springframework.jdbc.support.SQLErrorCodes">
|
||||
<property name="databaseProductName"><value>DB1*</value></property>
|
||||
<property name="badSqlGrammarCodes"><value>-204,1,2</value></property>
|
||||
<property name="dataIntegrityViolationCodes"><value>3,4</value></property>
|
||||
</bean>
|
||||
|
||||
<bean id="DB2" class="org.springframework.jdbc.support.SQLErrorCodes">
|
||||
<property name="databaseProductName"><value>*DB2*</value></property>
|
||||
<property name="badSqlGrammarCodes"><value>-204,1,2</value></property>
|
||||
<property name="dataIntegrityViolationCodes"><value>3,4</value></property>
|
||||
</bean>
|
||||
|
||||
<bean id="DB3" class="org.springframework.jdbc.support.SQLErrorCodes">
|
||||
<property name="databaseProductName"><value>*DB3*</value></property>
|
||||
<property name="badSqlGrammarCodes"><value>-204,1,2</value></property>
|
||||
<property name="dataIntegrityViolationCodes"><value>3,4</value></property>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
Reference in New Issue
Block a user