У меня в YML есть эти конфигурации JPA.
jpa:
database-platform: DB2Platform
ddl-auto: create-drop
hibernate:
properties:
dialect: org.hibernate.dialect.DB2Dialect
Но при запуске приложения оно не работает, потому что читает H2Dialect:
2020-03-10 11:11:07.980 INFO PID_IS_UNDEFINED [ main] org.hibernate.Version : --- HHH000412: Hibernate Core {5.3.7.Final}
2020-03-10 11:11:08.076 INFO PID_IS_UNDEFINED [ main] org.hibernate.cfg.Environment : --- HHH000206: hibernate.properties not found
2020-03-10 11:11:08.503 INFO PID_IS_UNDEFINED [ main] o.hibernate.annotations.common.Version : --- HCANN000001: Hibernate Commons Annotations {5.0.4.Final}
2020-03-10 11:11:09.692 INFO PID_IS_UNDEFINED [ main] org.hibernate.dialect.Dialect : --- HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
2020-03-10 11:11:10.187 INFO PID_IS_UNDEFINED [ main] o.h.validator.internal.util.Version : --- HV000001: Hibernate Validator 6.0.14.Final
2020-03-10 11:11:10.552 INFO PID_IS_UNDEFINED [ main] o.h.t.schema.internal.SchemaCreatorImpl : --- HHH000476: Executing import script 'org.hibernate.tool.schema.internal.exec.ScriptSourceInputNonExistentImpl@14911c1'
2020-03-10 11:11:10.639 INFO PID_IS_UNDEFINED [ main] j.LocalContainerEntityManagerFactoryBean : --- Initialized JPA EntityManagerFactory for persistence unit 'default'
2020-03-10 11:11:10.759 WARN PID_IS_UNDEFINED [ main] o.s.c.support.GenericApplicationContext : --- Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Initialization of bean failed; nested exception is org.springframework.jdbc.datasource.init.ScriptStatementFailedException: Failed to execute SQL script statement #1 of URL [file:/C:/Users/0016162/Documents/Workspace/api-arranques-vep/target/classes/data.sql]: INSERT INTO T6032500 (CEMPRESA, CMONPAGO, DMONPAGO, XMONFUNC, XPERENCU, XCOMPUTA, XBONISRV) VALUES('01', '001', 'FPP', '6', '1', '0', '1'); nested exception is org.h2.jdbc.JdbcSQLException: Tabla "T6032500" no encontrada
Я использую версию Spring 2.1.3
Я добавляю конфигурация БД:
spring:
profiles: ******
datasource:
jdbc-url: jdbc:db2://ds81wszs.pre.geci:#####/DS81
username: ********
password: ********
driver-class-name: com.ibm.db2.jcc.DB2Driver
testWhileIdle: true
continueOnError: true
connectionTestQuery: select 1 from sysibm.sysdummy1
autoCommit: true
connectionTimeout: 30000
idleTimeout: 600000
maxLifetime: 1800000
minimumIdle: 10
maximumPoolSize: 10
initializationFailTimeout: 1
isolateInternalQueries: false
allowPoolSuspension: false
readOnly: false
registerMbeans: false
transactionIsolation: TRANSACTION_READ_UNCOMMITTED
validationTimeout: 5000
leakDetectionThreshold: 0
jpa:
database-platform: DB2Platform
properties:
hibernate:
dialect: org.hibernate.dialect.DB2Dialect
Я скрыл данные соединения.