fixed error caused because POSITION is a keyword in Hsql, but not in DB2.

This commit is contained in:
lucasward
2007-09-05 23:32:07 +00:00
parent fbb5c5c34e
commit 4e9fd48285
5 changed files with 16 additions and 6 deletions

View File

@@ -16,7 +16,7 @@ import org.springframework.jdbc.core.JdbcTemplate;
public class SqlNflPlayerDao implements NflPlayerDao, InitializingBean {
public static final String INSERT_PLAYER = "INSERT into players(player_id, " +
"last_name, first_name, position, year_of_birth, year_drafted)" +
"last_name, first_name, pos, year_of_birth, year_drafted)" +
" values (?,?,?,?,?,?)";
DataSource dataSource;

View File

@@ -199,4 +199,9 @@ public class NflGame {
}
public String toString() {
return "NFL Game: ID=" + id + " " + team + " vs. " + opponent +
" - " + year;
}
}

View File

@@ -95,4 +95,8 @@ public class NflPlayerSummary {
this.totalTd = totalTd;
}
public String toString() {
return "NFL Player Summary: ID=" + id + " Year=" + year;
}
}

View File

@@ -37,12 +37,12 @@ INSERT INTO customer (id, version, name, credit) VALUES (3, 0, 'customer3', 1000
INSERT INTO customer (id, version, name, credit) VALUES (4, 0, 'customer4', 100000);
CREATE TABLE PLAYERS (
PLAYER_ID char(8) not null primary key,
PLAYER_ID char(8) primary key,
LAST_NAME varchar(35) not null,
FIRST_NAME varchar(25) not null,
POSITION varchar(10),
YEAR_OF_BIRTH integer not null,
YEAR_DRAFTED integer not null);
POS varchar(10),
YEAR_OF_BIRTH BIGINT not null,
YEAR_DRAFTED BIGINT not null);
CREATE TABLE GAMES (
PLAYER_ID char(8) not null,

View File

@@ -5,7 +5,8 @@
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.0.xsd">
<!-- Initialise the database before every test case: -->
<!-- Initialise the database before every test case: -->
<import resource="data-source-context-init.xml"/>
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="${batch.jdbc.driver}" />