diff --git a/spring-batch-samples/src/main/java/org/springframework/batch/sample/domain/football/internal/JdbcPlayerDao.java b/spring-batch-samples/src/main/java/org/springframework/batch/sample/domain/football/internal/JdbcPlayerDao.java
index ccd8cf813..fea347d8a 100644
--- a/spring-batch-samples/src/main/java/org/springframework/batch/sample/domain/football/internal/JdbcPlayerDao.java
+++ b/spring-batch-samples/src/main/java/org/springframework/batch/sample/domain/football/internal/JdbcPlayerDao.java
@@ -28,7 +28,7 @@ import org.springframework.jdbc.core.namedparam.BeanPropertySqlParameterSource;
public class JdbcPlayerDao extends SimpleJdbcDaoSupport implements PlayerDao {
public static final String INSERT_PLAYER =
- "INSERT into players(player_id, last_name, first_name, pos, year_of_birth, year_drafted)" +
+ "INSERT into PLAYERS (player_id, last_name, first_name, pos, year_of_birth, year_drafted)" +
" values (:id, :lastName, :firstName, :position, :birthYear, :debutYear)";
public void savePlayer(Player player) {
diff --git a/spring-batch-samples/src/main/java/org/springframework/batch/sample/domain/trade/internal/JdbcCustomerDebitDao.java b/spring-batch-samples/src/main/java/org/springframework/batch/sample/domain/trade/internal/JdbcCustomerDebitDao.java
index 9ae088a9c..c3a956b41 100644
--- a/spring-batch-samples/src/main/java/org/springframework/batch/sample/domain/trade/internal/JdbcCustomerDebitDao.java
+++ b/spring-batch-samples/src/main/java/org/springframework/batch/sample/domain/trade/internal/JdbcCustomerDebitDao.java
@@ -32,7 +32,7 @@ import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
*/
public class JdbcCustomerDebitDao implements CustomerDebitDao {
- private static final String UPDATE_CREDIT = "UPDATE customer SET credit= credit-? WHERE name=?";
+ private static final String UPDATE_CREDIT = "UPDATE CUSTOMER SET credit= credit-? WHERE name=?";
private SimpleJdbcOperations simpleJdbcTemplate;
diff --git a/spring-batch-samples/src/main/java/org/springframework/batch/sample/domain/trade/internal/JdbcTradeDao.java b/spring-batch-samples/src/main/java/org/springframework/batch/sample/domain/trade/internal/JdbcTradeDao.java
index fd5569963..7ba7d373a 100644
--- a/spring-batch-samples/src/main/java/org/springframework/batch/sample/domain/trade/internal/JdbcTradeDao.java
+++ b/spring-batch-samples/src/main/java/org/springframework/batch/sample/domain/trade/internal/JdbcTradeDao.java
@@ -36,7 +36,7 @@ public class JdbcTradeDao implements TradeDao {
/**
* template for inserting a row
*/
- private static final String INSERT_TRADE_RECORD = "INSERT INTO trade (id, version, isin, quantity, price, customer) VALUES (?, 0, ?, ? ,?, ?)";
+ private static final String INSERT_TRADE_RECORD = "INSERT INTO TRADE (id, version, isin, quantity, price, customer) VALUES (?, 0, ?, ? ,?, ?)";
/**
* handles the processing of sql query
diff --git a/spring-batch-samples/src/main/java/test/jdbc/datasource/DataSourceInitializer.java b/spring-batch-samples/src/main/java/test/jdbc/datasource/DataSourceInitializer.java
index ccfdef88f..95dbfba9f 100644
--- a/spring-batch-samples/src/main/java/test/jdbc/datasource/DataSourceInitializer.java
+++ b/spring-batch-samples/src/main/java/test/jdbc/datasource/DataSourceInitializer.java
@@ -76,16 +76,6 @@ public class DataSourceInitializer implements InitializingBean, DisposableBean {
DataSourceInitializer.class.getSimpleName() + "-context.xml"));
}
- /**
- * @throws Throwable
- * @see java.lang.Object#finalize()
- */
- protected void finalize() throws Throwable {
- super.finalize();
- initialized = false;
- logger.debug("finalize called");
- }
-
public void destroy() {
if (destroyScripts==null) return;
for (int i = 0; i < destroyScripts.length; i++) {
@@ -102,6 +92,7 @@ public class DataSourceInitializer implements InitializingBean, DisposableBean {
}
}
}
+ initialized = false;
}
public void afterPropertiesSet() throws Exception {
diff --git a/spring-batch-samples/src/main/resources/batch-mysql.properties b/spring-batch-samples/src/main/resources/batch-mysql.properties
index 0fb7e68d7..f481d74a7 100644
--- a/spring-batch-samples/src/main/resources/batch-mysql.properties
+++ b/spring-batch-samples/src/main/resources/batch-mysql.properties
@@ -9,6 +9,7 @@ batch.jndi.name=
batch.naming.factory.initial=
batch.naming.provider.url=
batch.schema.script=schema-mysql.sql
+batch.drop.script=schema-drop-mysql.sql
batch.business.schema.script=business-schema-mysql.sql
batch.database.incrementer.class=org.springframework.jdbc.support.incrementer.MySQLMaxValueIncrementer
batch.lob.handler.class=org.springframework.jdbc.support.lob.DefaultLobHandler
diff --git a/spring-batch-samples/src/main/resources/jobs/footballJob.xml b/spring-batch-samples/src/main/resources/jobs/footballJob.xml
index c30dc60b9..a9fc571bf 100644
--- a/spring-batch-samples/src/main/resources/jobs/footballJob.xml
+++ b/spring-batch-samples/src/main/resources/jobs/footballJob.xml
@@ -85,12 +85,12 @@
- SELECT games.player_id, games.year_no, SUM(COMPLETES),
+ SELECT GAMES.player_id, GAMES.year_no, SUM(COMPLETES),
SUM(ATTEMPTS), SUM(PASSING_YARDS), SUM(PASSING_TD),
SUM(INTERCEPTIONS), SUM(RUSHES), SUM(RUSH_YARDS),
SUM(RECEPTIONS), SUM(RECEPTIONS_YARDS), SUM(TOTAL_TD)
- from games, players where players.player_id =
- games.player_id group by games.player_id, games.year_no
+ from GAMES, PLAYERS where PLAYERS.player_id =
+ GAMES.player_id group by GAMES.player_id, GAMES.year_no
diff --git a/spring-batch-samples/src/main/resources/jobs/iosample/jdbcCursor.xml b/spring-batch-samples/src/main/resources/jobs/iosample/jdbcCursor.xml
index 630113c89..1b0a36d8a 100644
--- a/spring-batch-samples/src/main/resources/jobs/iosample/jdbcCursor.xml
+++ b/spring-batch-samples/src/main/resources/jobs/iosample/jdbcCursor.xml
@@ -24,7 +24,7 @@
-
+
diff --git a/spring-batch-samples/src/main/resources/jobs/iosample/jdbcPaging.xml b/spring-batch-samples/src/main/resources/jobs/iosample/jdbcPaging.xml
index 98ed484c4..271062e12 100644
--- a/spring-batch-samples/src/main/resources/jobs/iosample/jdbcPaging.xml
+++ b/spring-batch-samples/src/main/resources/jobs/iosample/jdbcPaging.xml
@@ -54,7 +54,7 @@
class="org.springframework.batch.item.database.BeanPropertyItemSqlParameterSourceProvider" />
+ value="UPDATE CUSTOMER set credit = :credit where id = :id" />
diff --git a/spring-batch-samples/src/main/resources/jobs/tradeJob.xml b/spring-batch-samples/src/main/resources/jobs/tradeJob.xml
index ae0382340..313d8f2c5 100644
--- a/spring-batch-samples/src/main/resources/jobs/tradeJob.xml
+++ b/spring-batch-samples/src/main/resources/jobs/tradeJob.xml
@@ -55,7 +55,7 @@
-
+
diff --git a/spring-batch-samples/src/test/java/org/springframework/batch/sample/AbstractCustomerCreditIncreaseTests.java b/spring-batch-samples/src/test/java/org/springframework/batch/sample/AbstractCustomerCreditIncreaseTests.java
index 0024f57bb..cdb59b631 100644
--- a/spring-batch-samples/src/test/java/org/springframework/batch/sample/AbstractCustomerCreditIncreaseTests.java
+++ b/spring-batch-samples/src/test/java/org/springframework/batch/sample/AbstractCustomerCreditIncreaseTests.java
@@ -35,12 +35,12 @@ public abstract class AbstractCustomerCreditIncreaseTests extends AbstractValida
private static final BigDecimal CREDIT_INCREASE = CustomerCreditIncreaseProcessor.FIXED_AMOUNT;
- private static String[] customers = { "INSERT INTO customer (id, version, name, credit) VALUES (1, 0, 'customer1', 100000)",
- "INSERT INTO customer (id, version, name, credit) VALUES (2, 0, 'customer2', 100000)",
- "INSERT INTO customer (id, version, name, credit) VALUES (3, 0, 'customer3', 100000)",
- "INSERT INTO customer (id, version, name, credit) VALUES (4, 0, 'customer4', 100000)"};
+ private static String[] customers = { "INSERT INTO CUSTOMER (id, version, name, credit) VALUES (1, 0, 'customer1', 100000)",
+ "INSERT INTO CUSTOMER (id, version, name, credit) VALUES (2, 0, 'customer2', 100000)",
+ "INSERT INTO CUSTOMER (id, version, name, credit) VALUES (3, 0, 'customer3', 100000)",
+ "INSERT INTO CUSTOMER (id, version, name, credit) VALUES (4, 0, 'customer4', 100000)"};
- private static String DELETE_CUSTOMERS = "DELETE FROM customer";
+ private static String DELETE_CUSTOMERS = "DELETE FROM CUSTOMER";
private static final String ALL_CUSTOMERS = "select * from CUSTOMER order by ID";
diff --git a/spring-batch-samples/src/test/java/org/springframework/batch/sample/CompositeItemWriterSampleFunctionalTests.java b/spring-batch-samples/src/test/java/org/springframework/batch/sample/CompositeItemWriterSampleFunctionalTests.java
index c09a831b3..593fbf045 100644
--- a/spring-batch-samples/src/test/java/org/springframework/batch/sample/CompositeItemWriterSampleFunctionalTests.java
+++ b/spring-batch-samples/src/test/java/org/springframework/batch/sample/CompositeItemWriterSampleFunctionalTests.java
@@ -25,7 +25,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@ContextConfiguration()
public class CompositeItemWriterSampleFunctionalTests extends AbstractValidatingBatchLauncherTests {
- private static final String GET_TRADES = "SELECT isin, quantity, price, customer FROM trade order by isin";
+ private static final String GET_TRADES = "SELECT isin, quantity, price, customer FROM TRADE order by isin";
private static final String EXPECTED_OUTPUT_FILE = "Trade: [isin=UK21341EAH41,quantity=211,price=31.11,customer=customer1]"
+ "Trade: [isin=UK21341EAH42,quantity=212,price=32.11,customer=customer2]"
diff --git a/spring-batch-samples/src/test/java/org/springframework/batch/sample/CustomerFilterJobFunctionalTests.java b/spring-batch-samples/src/test/java/org/springframework/batch/sample/CustomerFilterJobFunctionalTests.java
index 5dfd5aeec..0954403c0 100644
--- a/spring-batch-samples/src/test/java/org/springframework/batch/sample/CustomerFilterJobFunctionalTests.java
+++ b/spring-batch-samples/src/test/java/org/springframework/batch/sample/CustomerFilterJobFunctionalTests.java
@@ -60,7 +60,8 @@ public class CustomerFilterJobFunctionalTests extends AbstractJobTests {
public void onSetUp() throws Exception {
simpleJdbcTemplate.update("delete from TRADE");
simpleJdbcTemplate.update("delete from CUSTOMER where ID > 4");
- List