1

I have been using Oracle for this without any trouble but I then had to switch it all over to use MySQL and am seeing this error during initialization:

org.springframework.dao.DataAccessResourceFailureException: Could not obtain sequence value; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown table 'BATCH_JOB_SEQ' in field list

The tables are present so its something else going wrong here. After debugging I captured the actual sql it was trying to perform to get the sequence:

select BATCH_JOB_SEQ.nextval from dual;

Which is obviously an Oracle statement! My config states this to setup the connection:

     <bean id="springDataSource"
        class="org.springframework.jdbc.datasource.DriverManagerDataSource">
      <property name="driverClassName" value="com.mysql.jdbc.Driver" />
      <property name="url" value="jdbc:mysql://10.252.205.5:3306/MASKNG" />
      <property name="username" value="MASKNG" />
      <property name="password" value="maskng" />
  </bean>

Any help appreciated...

zb226
  • 9,586
  • 6
  • 49
  • 79

2 Answers2

1

jobRepositoryFactoryBean.setDatabaseType(“mysql”)

0

Seems like there is no BATCH_JOB_SEQ created here in MySQL. You need to create the sequence for that. Refer How do I create a sequence in MySQL? for creating sequence.

Community
  • 1
  • 1
KayV
  • 12,987
  • 11
  • 98
  • 148