Spring quartz com.sybase.jdbc4.jdbc.SybDriver initialization script fail - java

I have a spring boot (vers 2.6.12) project with quartz and sybase jconnect driver dependencies(excluding all other deps):
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-quartz</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>sybase</groupId>
<artifactId>jconnect</artifactId>
<version>16.04.1</version>
</dependency>
I have my scheduler config:
#Configuration
#AllArgsConstructor
public class SchedulerConfig {
private final AutowireCapableBeanFactory beanFactory;
private final DataSource dataSource;
private final ApplicationContext context;
private final QuartzProperties quartzProperties;
#Bean
public SchedulerFactoryBean schedulerFactoryBean() {
var jobs = new SchedulerJobFactory(beanFactory);
jobs.setApplicationContext(context);
var properties = new Properties();
properties.putAll(quartzProperties.getProperties());
var factory = new SchedulerFactoryBean();
factory.setOverwriteExistingJobs(true);
factory.setDataSource(dataSource);
factory.setQuartzProperties(properties);
factory.setJobFactory(jobs);
return factory;
}
}
and my quartz initialization script (which is a modified version of the included sybase script:
/*==============================================================================*/
/* Clear all tables: */
/*==============================================================================*/
IF (OBJECT_ID('QRTZ_FIRED_TRIGGERS')) IS NOT NULL
begin
execute ('delete from QRTZ_FIRED_TRIGGERS')
end
IF OBJECT_ID('QRTZ_PAUSED_TRIGGER_GRPS') IS NOT NULL
begin
execute ('delete from QRTZ_PAUSED_TRIGGER_GRPS')
end
IF OBJECT_ID('QRTZ_SCHEDULER_STATE') IS NOT NULL
begin
execute ('delete from QRTZ_SCHEDULER_STATE')
end
IF OBJECT_ID('QRTZ_LOCKS') IS NOT NULL
begin
execute ('delete from QRTZ_LOCKS')
end
IF OBJECT_ID('QRTZ_SIMPLE_TRIGGERS') IS NOT NULL
begin
execute ('delete from QRTZ_SIMPLE_TRIGGERS')
end
IF OBJECT_ID('QRTZ_SIMPROP_TRIGGERS') IS NOT NULL
begin
execute ('delete from QRTZ_SIMPROP_TRIGGERS')
end
IF OBJECT_ID('QRTZ_CRON_TRIGGERS') IS NOT NULL
begin
execute ('delete from QRTZ_CRON_TRIGGERS')
end
IF OBJECT_ID('QRTZ_BLOB_TRIGGERS') IS NOT NULL
begin
execute ('delete from QRTZ_BLOB_TRIGGERS')
end
IF OBJECT_ID('QRTZ_TRIGGERS') IS NOT NULL
begin
execute ('delete from QRTZ_TRIGGERS')
end
IF OBJECT_ID('QRTZ_JOB_DETAILS') IS NOT NULL
begin
execute ('delete from QRTZ_JOB_DETAILS')
end
IF OBJECT_ID('QRTZ_CALENDARS') IS NOT NULL
begin
execute ('delete from QRTZ_CALENDARS')
end
/*==============================================================================*/
/* Drop constraints: */
/*==============================================================================*/
IF OBJECT_ID('QRTZ_TRIGGERS') IS NOT NULL
begin
execute ('alter table QRTZ_TRIGGERS drop
constraint FK_triggers_job_details')
end
IF OBJECT_ID('QRTZ_CRON_TRIGGERS') IS NOT NULL
begin
execute ('alter table QRTZ_CRON_TRIGGERS drop
constraint FK_cron_triggers_triggers')
end
IF OBJECT_ID('QRTZ_SIMPLE_TRIGGERS') IS NOT NULL
begin
execute ('alter table QRTZ_SIMPLE_TRIGGERS
drop constraint FK_simple_triggers_triggers')
end
IF OBJECT_ID('QRTZ_SIMPROP_TRIGGERS') IS NOT NULL
begin
execute ('alter table QRTZ_SIMPROP_TRIGGERS
drop constraint FK_simprop_triggers_triggers')
end
IF OBJECT_ID('QRTZ_BLOB_TRIGGERS') IS NOT NULL
begin
execute ('alter table QRTZ_BLOB_TRIGGERS
drop constraint FK_blob_triggers_triggers')
end
/*==============================================================================*/
/* Drop tables: */
/*==============================================================================*/
IF OBJECT_ID('QRTZ_FIRED_TRIGGERS') IS NOT NULL
begin
execute ('drop table QRTZ_FIRED_TRIGGERS')
end
IF OBJECT_ID('QRTZ_PAUSED_TRIGGER_GRPS') IS NOT NULL
begin
execute ('drop table QRTZ_PAUSED_TRIGGER_GRPS')
end
IF OBJECT_ID('QRTZ_SCHEDULER_STATE') IS NOT NULL
begin
execute ('drop table QRTZ_SCHEDULER_STATE')
end
IF OBJECT_ID('QRTZ_LOCKS') IS NOT NULL
begin
execute ('drop table QRTZ_LOCKS')
end
IF OBJECT_ID('QRTZ_SIMPLE_TRIGGERS') IS NOT NULL
begin
execute ('drop table QRTZ_SIMPLE_TRIGGERS')
end
IF OBJECT_ID('QRTZ_SIMPROP_TRIGGERS') IS NOT NULL
begin
execute ('drop table QRTZ_SIMPROP_TRIGGERS')
end
IF OBJECT_ID('QRTZ_CRON_TRIGGERS') IS NOT NULL
begin
execute ('drop table QRTZ_CRON_TRIGGERS')
end
IF OBJECT_ID('QRTZ_BLOB_TRIGGERS') IS NOT NULL
begin
execute ('drop table QRTZ_BLOB_TRIGGERS')
end
IF OBJECT_ID('QRTZ_TRIGGERS') IS NOT NULL
begin
execute ('drop table QRTZ_TRIGGERS')
end
IF OBJECT_ID('QRTZ_JOB_DETAILS') IS NOT NULL
begin
execute ('drop table QRTZ_JOB_DETAILS')
end
IF OBJECT_ID('QRTZ_CALENDARS') IS NOT NULL
begin
execute ('drop table QRTZ_CALENDARS')
end
/*==============================================================================*/
/* Create tables: */
/*==============================================================================*/
IF OBJECT_ID('QRTZ_CALENDARS') IS NULL
begin
execute('create table QRTZ_CALENDARS (
SCHED_NAME varchar(120) not null,
CALENDAR_NAME varchar(200) not null,
CALENDAR image not null
)')
end
IF OBJECT_ID('QRTZ_CRON_TRIGGERS') IS NULL
begin
execute('create table QRTZ_CRON_TRIGGERS (
SCHED_NAME varchar(120) not null,
TRIGGER_NAME varchar(200) not null,
TRIGGER_GROUP varchar(200) not null,
CRON_EXPRESSION varchar(120) not null,
TIME_ZONE_ID varchar(80) null,
)')
end
IF OBJECT_ID('QRTZ_PAUSED_TRIGGER_GRPS') IS NULL
begin
execute('create table QRTZ_PAUSED_TRIGGER_GRPS (
SCHED_NAME varchar(120) not null,
TRIGGER_GROUP varchar(200) not null,
)')
end
IF OBJECT_ID('QRTZ_FIRED_TRIGGERS') IS NULL
begin
execute('create table QRTZ_FIRED_TRIGGERS(
SCHED_NAME varchar(120) not null,
ENTRY_ID varchar(95) not null,
TRIGGER_NAME varchar(200) not null,
TRIGGER_GROUP varchar(200) not null,
INSTANCE_NAME varchar(200) not null,
FIRED_TIME numeric(13,0) not null,
SCHED_TIME numeric(13,0) not null,
PRIORITY int not null,
STATE varchar(16) not null,
JOB_NAME varchar(200) null,
JOB_GROUP varchar(200) null,
IS_NONCONCURRENT bit not null,
REQUESTS_RECOVERY bit not null,
)')
end
IF OBJECT_ID('QRTZ_SCHEDULER_STATE') IS NULL
begin
execute('create table QRTZ_SCHEDULER_STATE (
SCHED_NAME varchar(120) not null,
INSTANCE_NAME varchar(200) not null,
LAST_CHECKIN_TIME numeric(13,0) not null,
CHECKIN_INTERVAL numeric(13,0) not null,
)')
end
IF OBJECT_ID('QRTZ_LOCKS') IS NULL
begin
execute('create table QRTZ_LOCKS (
SCHED_NAME varchar(120) not null,
LOCK_NAME varchar(40) not null,
)')
end
IF OBJECT_ID('QRTZ_JOB_DETAILS') IS NULL
begin
execute('create table QRTZ_JOB_DETAILS (
SCHED_NAME varchar(120) not null,
JOB_NAME varchar(200) not null,
JOB_GROUP varchar(200) not null,
DESCRIPTION varchar(250) null,
JOB_CLASS_NAME varchar(250) not null,
IS_DURABLE bit not null,
IS_NONCONCURRENT bit not null,
IS_UPDATE_DATA bit not null,
REQUESTS_RECOVERY bit not null,
JOB_DATA image null
)')
end
IF OBJECT_ID('QRTZ_SIMPLE_TRIGGERS') IS NULL
begin
execute('create table QRTZ_SIMPLE_TRIGGERS (
SCHED_NAME varchar(120) not null,
TRIGGER_NAME varchar(200) not null,
TRIGGER_GROUP varchar(200) not null,
REPEAT_COUNT numeric(13,0) not null,
REPEAT_INTERVAL numeric(13,0) not null,
TIMES_TRIGGERED numeric(13,0) not null
)')
end
IF OBJECT_ID('QRTZ_SIMPROP_TRIGGERS') IS NULL
begin
execute('CREATE TABLE QRTZ_SIMPROP_TRIGGERS (
SCHED_NAME VARCHAR(120) NOT NULL,
TRIGGER_NAME VARCHAR(200) NOT NULL,
TRIGGER_GROUP VARCHAR(200) NOT NULL,
STR_PROP_1 VARCHAR(512) NULL,
STR_PROP_2 VARCHAR(512) NULL,
STR_PROP_3 VARCHAR(512) NULL,
INT_PROP_1 INT NULL,
INT_PROP_2 INT NULL,
LONG_PROP_1 NUMERIC(13,0) NULL,
LONG_PROP_2 NUMERIC(13,0) NULL,
DEC_PROP_1 NUMERIC(13,4) NULL,
DEC_PROP_2 NUMERIC(13,4) NULL,
BOOL_PROP_1 bit NOT NULL,
BOOL_PROP_2 bit NOT NULL
)')
end
IF OBJECT_ID('QRTZ_BLOB_TRIGGERS') IS NULL
begin
execute('create table QRTZ_BLOB_TRIGGERS (
SCHED_NAME varchar(120) not null,
TRIGGER_NAME varchar(200) not null,
TRIGGER_GROUP varchar(200) not null,
BLOB_DATA image null
)')
end
IF OBJECT_ID('QRTZ_TRIGGERS') IS NULL
begin
execute('create table QRTZ_TRIGGERS (
SCHED_NAME varchar(120) not null,
TRIGGER_NAME varchar(200) not null,
TRIGGER_GROUP varchar(200) not null,
JOB_NAME varchar(200) not null,
JOB_GROUP varchar(200) not null,
DESCRIPTION varchar(250) null,
NEXT_FIRE_TIME numeric(13,0) null,
PREV_FIRE_TIME numeric(13,0) null,
PRIORITY int null,
TRIGGER_STATE varchar(16) not null,
TRIGGER_TYPE varchar(8) not null,
START_TIME numeric(13,0) not null,
END_TIME numeric(13,0) null,
CALENDAR_NAME varchar(200) null,
MISFIRE_INSTR smallint null,
JOB_DATA image null
)')
end
/*==============================================================================*/
/* Create primary key constraints: */
/*==============================================================================*/
IF OBJECT_ID('QRTZ_CALENDARS') IS NOT NULL
begin
execute ('alter table QRTZ_CALENDARS
add constraint PK_qrtz_calendars primary key clustered (SCHED_NAME,CALENDAR_NAME)')
end
IF OBJECT_ID('QRTZ_CRON_TRIGGERS') IS NOT NULL
begin
execute ('alter table QRTZ_CRON_TRIGGERS
add constraint PK_qrtz_cron_triggers primary key clustered (SCHED_NAME,TRIGGER_NAME, TRIGGER_GROUP)')
end
IF OBJECT_ID('QRTZ_FIRED_TRIGGERS') IS NOT NULL
begin
execute ('alter table QRTZ_FIRED_TRIGGERS
add constraint PK_qrtz_fired_triggers primary key clustered (SCHED_NAME,ENTRY_ID)')
end
IF OBJECT_ID('QRTZ_PAUSED_TRIGGER_GRPS') IS NOT NULL
begin
execute ('alter table QRTZ_PAUSED_TRIGGER_GRPS
add constraint PK_qrtz_paused_trigger_grps primary key clustered (SCHED_NAME,TRIGGER_GROUP)')
end
IF OBJECT_ID('QRTZ_SCHEDULER_STATE') IS NOT NULL
begin
execute ('alter table QRTZ_SCHEDULER_STATE
add constraint PK_qrtz_scheduler_state primary key clustered (SCHED_NAME,INSTANCE_NAME)')
end
IF OBJECT_ID('QRTZ_LOCKS') IS NOT NULL
begin
execute ('alter table QRTZ_LOCKS
add constraint PK_qrtz_locks primary key clustered (SCHED_NAME,LOCK_NAME)')
end
IF OBJECT_ID('QRTZ_JOB_DETAILS') IS NOT NULL
begin
execute ('alter table QRTZ_JOB_DETAILS
add constraint PK_qrtz_job_details primary key clustered (SCHED_NAME,JOB_NAME, JOB_GROUP)')
end
IF OBJECT_ID('QRTZ_SIMPLE_TRIGGERS') IS NOT NULL
begin
execute ('alter table QRTZ_SIMPLE_TRIGGERS
add constraint PK_qrtz_simple_triggers primary key clustered (SCHED_NAME,TRIGGER_NAME, TRIGGER_GROUP)')
end
IF OBJECT_ID('QRTZ_SIMPROP_TRIGGERS') IS NOT NULL
begin
execute ('alter table QRTZ_SIMPROP_TRIGGERS
add constraint PK_qrtz_simprop_triggers primary key clustered (SCHED_NAME,TRIGGER_NAME, TRIGGER_GROUP)')
end
IF OBJECT_ID('QRTZ_TRIGGERS') IS NOT NULL
begin
execute ('alter table QRTZ_TRIGGERS
add constraint PK_qrtz_triggers primary key clustered (SCHED_NAME,TRIGGER_NAME, TRIGGER_GROUP)')
end
IF OBJECT_ID('QRTZ_BLOB_TRIGGERS') IS NOT NULL
begin
execute ('alter table QRTZ_BLOB_TRIGGERS
add constraint PK_qrtz_blob_triggers primary key clustered (SCHED_NAME,TRIGGER_NAME, TRIGGER_GROUP)')
end
/*==============================================================================*/
/* Create foreign key constraints: */
/*==============================================================================*/
IF OBJECT_ID('QRTZ_CRON_TRIGGERS') IS NOT NULL
begin
execute ('alter table QRTZ_CRON_TRIGGERS
add constraint FK_cron_triggers_triggers foreign key (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
references QRTZ_TRIGGERS (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)')
end
IF OBJECT_ID('QRTZ_SIMPLE_TRIGGERS') IS NOT NULL
begin
execute ('alter table QRTZ_SIMPLE_TRIGGERS
add constraint FK_simple_triggers_triggers foreign key (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
references QRTZ_TRIGGERS (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)')
end
IF OBJECT_ID('QRTZ_SIMPROP_TRIGGERS') IS NOT NULL
begin
execute ('alter table QRTZ_SIMPROP_TRIGGERS
add constraint FK_simprop_triggers_triggers foreign key (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
references QRTZ_TRIGGERS (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)')
end
IF OBJECT_ID('QRTZ_TRIGGERS') IS NOT NULL
begin
execute ('alter table QRTZ_TRIGGERS
add constraint FK_triggers_job_details foreign key (SCHED_NAME,JOB_NAME,JOB_GROUP)
references QRTZ_JOB_DETAILS (SCHED_NAME,JOB_NAME,JOB_GROUP)')
end
IF OBJECT_ID('QRTZ_BLOB_TRIGGERS') IS NOT NULL
begin
execute ('alter table QRTZ_BLOB_TRIGGERS
add constraint FK_blob_triggers_triggers foreign key (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
references QRTZ_TRIGGERS (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)')
end
/*==============================================================================*/
/* End of script. */
/*==============================================================================*/
I am running this script through DBeaver without issues against a sybase instance with details:
Server: Adaptive Server Enterprise 16.0.04.02
Driver: jConnect (TM) for JDBC (TM) jConnect (TM) for JDBC(TM)/16.0 SP03 PL02 (Build 27403)/P/EBF27518/JDK 1.6.0/jdbcmain/OPT/Mon Aug 28 18:41:14 PDT 2017
My (relevant) spring application settings:
spring.datasource.url=jdbc:sybase:Tds:localhost:6000/Kustom
spring.datasource.driverClassName=com.sybase.jdbc4.jdbc.SybDriver
spring.datasource.username=user
spring.datasource.password=pass
spring.jpa.database-platform=org.hibernate.dialect.SybaseASE15Dialect
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.SybaseASE15Dialect
spring.jpa.properties.hibernate.use_sql_comments=true
spring.jpa.properties.hibernate.format_sql=true
spring.quartz.job-store-type=jdbc
spring.quartz.jdbc.initialize-schema=always
spring.quartz.jdbc.schema=classpath:jdbc/my_script.sql
spring.quartz.properties.org.quartz.jobStore.tablePrefix=QRTZ_
spring.quartz.properties.org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.SybaseDelegate
spring.jpa.show-sql=true
spring.jpa.generate-ddl=true
spring.jpa.hibernate.ddl-auto=update
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl
logging.level.org.hibernate.type=TRACE
My application keeps failing with the following stack trace:
2023-02-15 10:48:53.630 INFO 1 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.SybaseASE15Dialect
2023-02-15 10:48:53.766 DEBUG 1 --- [ main] o.h.type.spi.TypeConfiguration$Scope : Scoping TypeConfiguration [org.hibernate.type.spi.TypeConfiguration#385ef531] to MetadataBuildingContext [org.hibernate.boot.internal.MetadataBuildingContextRootImpl#7fc645e4]
2023-02-15 10:48:54.136 DEBUG 1 --- [ main] o.h.type.spi.TypeConfiguration$Scope : Scoping TypeConfiguration [org.hibernate.type.spi.TypeConfiguration#385ef531] to SessionFactoryImpl [org.hibernate.internal.SessionFactoryImpl#48284d0e]
2023-02-15 10:48:54.303 WARN 1 --- [ main] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 911, SQLState: ZZZZZ
2023-02-15 10:48:54.303 ERROR 1 --- [ main] o.h.engine.jdbc.spi.SqlExceptionHelper : Attempt to locate entry in sysdatabases for database 'KUSTOM' by name failed - no entry found under that name. Make sure that name is entered properly.
2023-02-15 10:48:54.307 TRACE 1 --- [ main] o.h.type.spi.TypeConfiguration$Scope : Handling #sessionFactoryClosed from [org.hibernate.internal.SessionFactoryImpl#48284d0e] for TypeConfiguration
2023-02-15 10:48:54.308 DEBUG 1 --- [ main] o.h.type.spi.TypeConfiguration$Scope : Un-scoping TypeConfiguration [org.hibernate.type.spi.TypeConfiguration$Scope#11e33bac] from SessionFactory [org.hibernate.internal.SessionFactoryImpl#48284d0e]
2023-02-15 10:48:54.313 ERROR 1 --- [ main] j.LocalContainerEntityManagerFactoryBean : Failed to initialize JPA EntityManagerFactory: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.exception.GenericJDBCException: Error accessing table metadata
2023-02-15 10:48:54.314 WARN 1 --- [ main] onfigReactiveWebServerApplicationContext : 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]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.exception.GenericJDBCException: Error accessing table metadata
2023-02-15 10:48:54.315 INFO 1 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2023-02-15 10:48:54.946 INFO 1 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
2023-02-15 10:48:54.958 INFO 1 --- [ main] o.e.jetty.server.handler.ContextHandler : Stopped o.e.j.s.ServletContextHandler#3dd69f5a{/,null,STOPPED}
2023-02-15 10:48:54.999 INFO 1 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2023-02-15 10:48:55.098 ERROR 1 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.exception.GenericJDBCException: Error accessing table metadata
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804) ~[spring-beans-5.3.23.jar!/:5.3.23]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[spring-beans-5.3.23.jar!/:5.3.23]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.23.jar!/:5.3.23]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.23.jar!/:5.3.23]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.23.jar!/:5.3.23]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.23.jar!/:5.3.23]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.23.jar!/:5.3.23]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154) ~[spring-context-5.3.23.jar!/:5.3.23]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:908) ~[spring-context-5.3.23.jar!/:5.3.23]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.23.jar!/:5.3.23]
at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh(ReactiveWebServerApplicationContext.java:64) ~[spring-boot-2.6.12.jar!/:2.6.12]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:745) ~[spring-boot-2.6.12.jar!/:2.6.12]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:420) ~[spring-boot-2.6.12.jar!/:2.6.12]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) ~[spring-boot-2.6.12.jar!/:2.6.12]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1317) ~[spring-boot-2.6.12.jar!/:2.6.12]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) ~[spring-boot-2.6.12.jar!/:2.6.12]
at com.finastra.fusionlimits.enquiries.scheduler.app.Application.main(Application.java:14) ~[classes!/:1.0.0-SNAPSHOT]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) ~[app.jar:1.0.0-SNAPSHOT]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) ~[app.jar:1.0.0-SNAPSHOT]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[app.jar:1.0.0-SNAPSHOT]
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) ~[app.jar:1.0.0-SNAPSHOT]
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.exception.GenericJDBCException: Error accessing table metadata
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:421) ~[spring-orm-5.3.23.jar!/:5.3.23]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396) ~[spring-orm-5.3.23.jar!/:5.3.23]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341) ~[spring-orm-5.3.23.jar!/:5.3.23]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863) ~[spring-beans-5.3.23.jar!/:5.3.23]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) ~[spring-beans-5.3.23.jar!/:5.3.23]
... 24 common frames omitted
Caused by: org.hibernate.exception.GenericJDBCException: Error accessing table metadata
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42) ~[hibernate-core-5.6.11.Final.jar!/:5.6.11.Final]
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113) ~[hibernate-core-5.6.11.Final.jar!/:5.6.11.Final]
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:99) ~[hibernate-core-5.6.11.Final.jar!/:5.6.11.Final]
at org.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl.convertSQLException(AbstractInformationExtractorImpl.java:118) ~[hibernate-core-5.6.11.Final.jar!/:5.6.11.Final]
at org.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl.getTables(AbstractInformationExtractorImpl.java:571) ~[hibernate-core-5.6.11.Final.jar!/:5.6.11.Final]
at org.hibernate.tool.schema.extract.internal.DatabaseInformationImpl.getTablesInformation(DatabaseInformationImpl.java:122) ~[hibernate-core-5.6.11.Final.jar!/:5.6.11.Final]
at org.hibernate.tool.schema.internal.GroupedSchemaMigratorImpl.performTablesMigration(GroupedSchemaMigratorImpl.java:68) ~[hibernate-core-5.6.11.Final.jar!/:5.6.11.Final]
at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.performMigration(AbstractSchemaMigrator.java:220) ~[hibernate-core-5.6.11.Final.jar!/:5.6.11.Final]
at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.doMigration(AbstractSchemaMigrator.java:123) ~[hibernate-core-5.6.11.Final.jar!/:5.6.11.Final]
at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:196) ~[hibernate-core-5.6.11.Final.jar!/:5.6.11.Final]
at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:85) ~[hibernate-core-5.6.11.Final.jar!/:5.6.11.Final]
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:335) ~[hibernate-core-5.6.11.Final.jar!/:5.6.11.Final]
at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:471) ~[hibernate-core-5.6.11.Final.jar!/:5.6.11.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1498) ~[hibernate-core-5.6.11.Final.jar!/:5.6.11.Final]
at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:58) ~[spring-orm-5.3.23.jar!/:5.3.23]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) ~[spring-orm-5.3.23.jar!/:5.3.23]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) ~[spring-orm-5.3.23.jar!/:5.3.23]
... 28 common frames omitted
Caused by: com.sybase.jdbc4.jdbc.SybSQLException: Attempt to locate entry in sysdatabases for database 'KUSTOM' by name failed - no entry found under that name. Make sure that name is entered properly.
at com.sybase.jdbc4.tds.Tds.processEed(Tds.java:4237) ~[jconnect-16.04.1.jar!/:na]
at com.sybase.jdbc4.tds.Tds.nextResult(Tds.java:3346) ~[jconnect-16.04.1.jar!/:na]
at com.sybase.jdbc4.jdbc.ResultGetter.nextResult(ResultGetter.java:78) ~[jconnect-16.04.1.jar!/:na]
at com.sybase.jdbc4.jdbc.SybStatement.nextResult(SybStatement.java:303) ~[jconnect-16.04.1.jar!/:na]
at com.sybase.jdbc4.jdbc.SybStatement.nextResult(SybStatement.java:285) ~[jconnect-16.04.1.jar!/:na]
at com.sybase.jdbc4.jdbc.SybStatement.queryLoop(SybStatement.java:2681) ~[jconnect-16.04.1.jar!/:na]
at com.sybase.jdbc4.jdbc.SybCallableStatement.executeQuery(SybCallableStatement.java:150) ~[jconnect-16.04.1.jar!/:na]
at com.sybase.jdbc4.jdbc.SybDatabaseMetaData.returnResults(SybDatabaseMetaData.java:5552) ~[jconnect-16.04.1.jar!/:na]
at com.sybase.jdbc4.jdbc.SybDatabaseMetaData.getTables(SybDatabaseMetaData.java:4022) ~[jconnect-16.04.1.jar!/:na]
at com.zaxxer.hikari.pool.ProxyDatabaseMetaData.getTables(ProxyDatabaseMetaData.java:68) ~[HikariCP-4.0.3.jar!/:na]
at com.zaxxer.hikari.pool.HikariProxyDatabaseMetaData.getTables(HikariProxyDatabaseMetaData.java) ~[HikariCP-4.0.3.jar!/:na]
at org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.processTableResultSet(InformationExtractorJdbcDatabaseMetaDataImpl.java:64) ~[hibernate-core-5.6.11.Final.jar!/:5.6.11.Final]
at org.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl.getTables(AbstractInformationExtractorImpl.java:559) ~[hibernate-core-5.6.11.Final.jar!/:5.6.11.Final]
... 40 common frames omitted
PS: Same issue using the included script with quartz (linked earlier).
However if I am using the sourceforge driver with :
spring.datasource.url=jdbc:jtds:sybase://localhost:6000/Kustom
spring.datasource.driverClassName=net.sourceforge.jtds.jdbc.Driver
# Also need these just for the test connection which sourceforge driver is lacking
spring.datasource.validationQuery=select 1
spring.datasource.hikari.connectionTestQuery=select 1
then all seems to work as expected.
How can I make it work using the more modern jconnect driver ?
Thanks

Related

MySQL illegal mix of collations for operation '=' on a simple INSERT

There is a lot of questions about collation mixup in SELECT and INSERT * SELECT statements. Mine is a simple INSERT with nothing added to it but the data.
The error spawned in the process is:
Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '='
All field names and table names have been simplified. The query being executed is:
INSERT INTO table1 (`a`,`b`,`c`,`d`,`e`,`f`,`g`,`h`,`i`,`j`) VALUES (?,?,?,?,?,?,?,?,?,?);```
It has been prepared to receive some data that is brought in by the Java process with JDBI.
The underlying tables have nothing odd about them. Their DDLs look as follows.
CREATE TABLE `table1` (
`a` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`b` varchar(6) COLLATE utf8_unicode_ci DEFAULT NULL,
`c` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`d` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`e` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`f` int(11) DEFAULT NULL,
`g` text COLLATE utf8_unicode_ci,
`h` bigint(20) DEFAULT NULL,
`i` bigint(20) DEFAULT NULL,
`j` datetime DEFAULT NULL,
`k` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`a`,`e`),
KEY `c` (`c`,`d`),
CONSTRAINT `fk_1` FOREIGN KEY (`a`) REFERENCES `table2` (`a2`),
CONSTRAINT `fk_2` FOREIGN KEY (`c`, `d`) REFERENCES `table3` (`a3`, `b3`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
CREATE TABLE `table2` (
`a2` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`b2` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL,
`c2` mediumtext COLLATE utf8_unicode_ci,
`d2` mediumtext COLLATE utf8_unicode_ci,
`e2` bigint(11) DEFAULT '0',
PRIMARY KEY (`a2`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
CREATE TABLE `table3` (
`a3` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`b3` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`a3`,`b3`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
As can be seen, there is absolutely nothing about the collation that I can understand. Is it possible that the data coming in from the java world is causing this? Could it be related to the current connection session variables?
UPDATE
I forgot to add the MySQL version: 5.6
I have solved this issue in my test runs moving all field collations to DEFAULT and the table collation to utf8_general_ci on table1. However, this is an unacceptable solution to the problem and it does not come close to answering how can there be a collation mixup in a simple INSERT statement?
I found the culprit. There is a TRIGGER on this table that references another table from another schema. The conflict exists in the trigger statements which does not help that the error message makes no allusion to such fact.
That answers
how can there be a collation mixup in a simple INSERT statement?
There is a TRIGGER accompanying the INSERT

Error Code: 1215 - Cannot add foreign key constraint

I am running this Query on MySQL workbench with the latest version of MySQL installed on MacOS.
My SQL Query is:
CREATE DATABASE IF NOT EXISTS `imdb`;
USE `imdb`;
DROP TABLE IF EXISTS `rating`;
DROP TABLE IF EXISTS `media`;
CREATE TABLE `media` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(70) DEFAULT NULL,
`year` varchar(70) DEFAULT NULL,
`rated` varchar(70) DEFAULT NULL,
`released` varchar(70) DEFAULT NULL,
`runtime` varchar(70) DEFAULT NULL,
`genre` varchar(70) DEFAULT NULL,
`director` varchar(70) DEFAULT NULL,
`writer` varchar(70) DEFAULT NULL,
`actors` varchar(70) DEFAULT NULL,
`plot` varchar(7000) DEFAULT NULL,
`language` varchar(70) DEFAULT NULL,
`country` varchar(70) DEFAULT NULL,
`awards` varchar(70) DEFAULT NULL,
`poster` varchar(270) DEFAULT NULL,
`metascore` varchar(70) DEFAULT NULL,
`imdb_rating` varchar(70) DEFAULT NULL,
`imdb_votes` varchar(70) DEFAULT NULL,
`imdb_id` varchar(70) NOT NULL,
`type` varchar(70) DEFAULT NULL,
`dvd` varchar(70) DEFAULT NULL,
`box_office` varchar(70) DEFAULT NULL,
`production` varchar(70) DEFAULT NULL,
`website` varchar(70) DEFAULT NULL,
`response` varchar(70) DEFAULT NULL,
PRIMARY KEY (`id`)
);
CREATE TABLE `rating` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`source` varchar(70) DEFAULT NULL,
`value` varchar(70) DEFAULT NULL,
`imdb_id` varchar(70) NOT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (`imdb_id`)
REFERENCES `media`(`imdb_id`)
ON DELETE SET NULL
);
SET FOREIGN_KEY_CHECKS = 1;
The create Query on table rating is failing. I don't know why, any help would be appreciated.
The exact error response is:
10:12:44
CREATE TABLE `rating` ( `id` int(11) NOT NULL AUTO_INCREMENT, `source` varchar(70) DEFAULT NULL, `value` varchar(70) DEFAULT NULL, `imdb_id` varchar(70) NOT NULL, PRIMARY KEY (`id`), FOREIGN KEY (`imdb_id`) REFERENCES `media`(`imdb_id`) ON DELETE SET NULL )
Error Code: 1215.
Cannot add foreign key constraint
0.123 sec
I am building a Spring REST application that uses one too many relationships for building a local copy of the IMDB database or something similar.
A foreign key in MySQL doesn't actually have to reference a primary key column, but it does have to reference a column which is unique. So, one possible fix here would be to add a unique constraint on the imdb_id column:
ALTER TABLE media ADD CONSTRAINT cstr_imdb UNIQUE (imdb_id);
A foreign key is a column or group of columns in a relational database table that provides a link between data in two tables. It acts as a cross-reference between tables because it references the primary key of another table, thereby establishing a link between them.
'id' is the primary key in your table 'media' and not 'imdb_id'. Hence, you can't make a reference to 'imdb_id'.
imdb_id is not a key on the media table - foreign keys must reference keys (or, at least, unique constraints). If imdb_id on the media table should be unique, then you could put a UNIQUE CONSTRAINT on it and will be able to reference it with a foreign key.
Also, you have on delete set null on a column that cannot be null

java.sql.SQLException: Unexpected token: REFERENCES

I'm getting an exception for my Create Statement query when using hibernate-sql mapping. Here is the create statement (Postgres) and the error it complains about.
Query:
CREATE TABLE translation (
translation_id INTEGER NOT NULL DEFAULT nextval('translation_seq'::regclass) PRIMARY KEY,
category TEXT NOT NULL,
sub_category TEXT DEFAULT NULL,
prod_id INTEGER NOT NULL REFERENCES product(product_id),
date_created DATE DEFAULT now() NOT NULL,
expired BOOLEAN DEFAULT FALSE NOT NULL
);
Exception / failure in the Test:
java.lang.RuntimeException: HypersonicAccessor.dbInitSchema() failure.
at com.package1.package2.package3.database.HypersonicAccessor.dbInitSchema(HypersonicAccessor.java:210)
at com.package1.package2.package3.someDbConfig.initialize(ProdDbConfig.java:145)
at com.package1.package2.package3.backend.client.UpdaterTest.setUp(UpdaterTest.java:57)
Caused by: java.sql.SQLException: Unexpected token: REFERENCES in statement
[CREATE TABLE TRANSLATION (TRANSLATION_ID BIGINT NOT NULL PRIMARY KEY,
CATEGORY VARCHAR NOT NULL, SUB_CATEGORY VARCHAR DEFAULT NULL,
PROD_ID BIGINT NOT NULL REFERENCES]
at com.package1.package2.package3.database.HypersonicDatabase.execute(HypersonicDatabase.java:146)
at com.package1.package2.package3.database.HypersonicDatabase.runSqlScript(HypersonicDatabase.java:169)
at com.package1.package2.package3.database.HypersonicAccessor.runScriptList(HypersonicAccessor.java:123)
at com.package1.package2.package3.database.HypersonicAccessor.dbInitSchema(HypersonicAccessor.java:157)
Im not sure if my query is wrong or something else is. Any clue what could possibly be wrong ? This actually is the same issue with a few of my tests that previously were passing but now they are not.

Creating a table programmatically using MyBatis and MySql

I want to create a method to dynamically create tables just passing the table name as a variable.
I have defined my xml mapper
<mapper namespace="com.mappers.TableCreatorMapper">
<cache />
<insert id="createNewTableIfNotExists" parameterType="String" >
CREATE TABLE IF NOT EXISTS #{tableName}
(
`ID` varchar(20) NOT NULL,
PRIMARY KEY (`ID`)
)
ENGINE=InnoDB
</insert>
</mapper>
And my Java Interface Mapper is simply:
public interface TableCreatorMapper {
public void createNewTableIfNotExists(String tableName);
}
but when I call my interface
tableCreatorMapper.createNewTableIfNotExists("test");
I get the following exception:
org.springframework.jdbc.BadSqlGrammarException:
### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''test'
(
`ID` varchar(20) NOT NULL,
PRIMARY KEY (`ID`)
' at line 1
### The error may involve com.mappers.TableCreatorMapper.createNewTableIfNotExists-Inline
### The error occurred while setting parameters
### SQL: CREATE TABLE IF NOT EXISTS ? ( `ID` varchar(20) NOT NULL, PRIMARY KEY (`ID`) ) ENGINE=InnoDB
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''test'
(
`ID` varchar(20) NOT NULL,
PRIMARY KEY (`ID`)
' at line 1
; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''test'
(
`ID` varchar(20) NOT NULL,
PRIMARY KEY (`ID`)
' at line 1
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:231)
at org.sp
If I instead change the query adding the ``for the table name:
CREATE TABLE IF NOT EXISTS `#{tableName}`(
`ID` varchar(20) NOT NULL,
PRIMARY KEY (`ID`)
)
ENGINE=InnoDB
I get
### The error occurred while setting parameters
### SQL: CREATE TABLE IF NOT EXISTS `?`( `ID` varchar(20) NOT NULL, PRIMARY KEY (`ID`) ) ENGINE=InnoDB
### Cause: java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).
; SQL []; Parameter index out of range (1 > number of parameters, which is 0).; nested exception is java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).
Any idea why?
try
CREATE TABLE IF NOT EXISTS ${_parameter}
(
`ID` varchar(20) NOT NULL,
PRIMARY KEY (`ID`)
)
ENGINE=InnoDB
#{name} is for parameters in PreparedStatement (see String Substitution in Parameters).
in DAO, use annotation #Param
void createTableIfNotExist(#Param("uuid") String uuid);
in MAPPER, use $
<update id="createTableIfNotExist" parameterType="java.lang.String">
CREATE TABLE IF NOT EXISTS `table_${uuid}`
(
`id` bigint(18) NOT NULL,
`info` varchar(18) NOT NULL,
PRIMARY KEY (`id`)
)
ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='this table is generated by java code.'
</update>
<bind> could be used in MAPPER too.

Java Prepared statement error table not found

I've got a problem with a data migration job build with Talend Open Studio for Data Integration. Talend open studio generates java classes. Im migration from one mysql table to another.
The statement:
String insert_tMysqlOutput_1 = "INSERT INTO `"
+ "workitem"
+ "` (`name`,`type`,`budgetHours`,`deadline`,`dateStart`,`dateEnd`,`dateCreated`,`projectId`,`parentWorkItem`,`description`,`dateUpdated`,`companyId`,`state`,`reporterId`,`assigneeId`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
java.sql.PreparedStatement pstmt_tMysqlOutput_1 = conn_tMysqlOutput_1
.prepareStatement(insert_tMysqlOutput_1);
The error:
Exception in component tMysqlOutput_1 com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'dashboard.work_item' doesn't exist
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
at com.mysql.jdbc.Util.getInstance(Util.java:384)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3566)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3498)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2113)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2568)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2113)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2409)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2327)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2312)
at dashboard_new.copy_of_workitem_2_0.Copy_of_workitem.tMysqlInput_1Process(Copy_of_workitem.java:3677)
at dashboard_new.copy_of_workitem_2_0.Copy_of_workitem.tMysqlConnection_2Process(Copy_of_workitem.java:1109)
at dashboard_new.copy_of_workitem_2_0.Copy_of_workitem.runJobInTOS(Copy_of_workitem.java:7370)
at dashboard_new.copy_of_workitem_2_0.Copy_of_workitem.main(Copy_of_workitem.java:7069)
Table structure (EDIT #1)
CREATE TABLE `dashboard`.`workitem` (
`workItemId` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`type` varchar(255) NOT NULL,
`projectId` bigint(20) NOT NULL DEFAULT '0',
`companyId` bigint(20) DEFAULT NULL,
`budgetHours` decimal(10,0) DEFAULT NULL,
`deadline` datetime DEFAULT NULL,
`dateStart` datetime DEFAULT NULL,
`dateEnd` datetime DEFAULT NULL,
`parentWorkItem` bigint(20) DEFAULT NULL,
`description` text,
`state` varchar(45) DEFAULT NULL,
`reporterId` bigint(20) DEFAULT NULL,
`assigneeId` bigint(20) DEFAULT NULL,
`dateCreated` datetime DEFAULT NULL,
`dateUpdated` datetime DEFAULT NULL,
`newColumn` varchar(10) DEFAULT NULL,
PRIMARY KEY (`workItemId`),
KEY `fk_project_id_idx` (`projectId`),
KEY `fk_parent_work_item_idx` (`parentWorkItem`),
KEY `fk_workitem_company1_idx` (`companyId`),
KEY `fk_workitem_name` (`name`),
KEY `fk_workitem_assignee` (`assigneeId`),
KEY `fk_workitem_reporter` (`reporterId`),
CONSTRAINT `fk_workitem_company1` FOREIGN KEY (`companyId`) REFERENCES `company` (`companyId`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=2461 DEFAULT CHARSET=latin1
The strange thing is.. work_item is not found in the code.. so i think there must by some caching of the statement but have no idea where..
EDIT #1:
And when i add a field into the query that does not exist inside the table then i get an error field not found.. so somehow check if the fields do exists.
Does anyone have any ideas?
Thanks
Something is accessing work_item, but the table's name is workitem.
Perhaps there is a trigger on the table that has a coding error in it.
Or perhaps you have not posted the latest versions.

Categories