kandi background
Explore Kits

HikariCP | JDBC connection pool | DB Client library

 by   brettwooldridge Java Version: Current License: Apache-2.0

 by   brettwooldridge Java Version: Current License: Apache-2.0

Download this library from

kandi X-RAY | HikariCP Summary

HikariCP is a Java library typically used in Utilities, DB Client applications. HikariCP has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has medium support. You can download it from GitHub, Maven.
Fast, simple, reliable. HikariCP is a "zero-overhead" production ready JDBC connection pool. At roughly 130Kb, the library is very light. Read about how we do it here.    "Simplicity is prerequisite for reliability."          - Edsger Dijkstra.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • HikariCP has a medium active ecosystem.
  • It has 16232 star(s) with 2466 fork(s). There are 739 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 323 open issues and 1207 have been closed. On average issues are closed in 95 days. There are 56 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of HikariCP is current.
HikariCP Support
Best in #DB Client
Average in #DB Client
HikariCP Support
Best in #DB Client
Average in #DB Client

quality kandi Quality

  • HikariCP has 0 bugs and 0 code smells.
HikariCP Quality
Best in #DB Client
Average in #DB Client
HikariCP Quality
Best in #DB Client
Average in #DB Client

securitySecurity

  • HikariCP has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • HikariCP code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
HikariCP Security
Best in #DB Client
Average in #DB Client
HikariCP Security
Best in #DB Client
Average in #DB Client

license License

  • HikariCP is licensed under the Apache-2.0 License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
HikariCP License
Best in #DB Client
Average in #DB Client
HikariCP License
Best in #DB Client
Average in #DB Client

buildReuse

  • HikariCP releases are not available. You will need to build from source code and install.
  • Deployable package is available in Maven.
  • Build file is available. You can build the component from source.
  • Installation instructions are not available. Examples and code snippets are available.
  • It has 13826 lines of code, 1278 functions and 103 files.
  • It has medium code complexity. Code complexity directly impacts maintainability of the code.
HikariCP Reuse
Best in #DB Client
Average in #DB Client
HikariCP Reuse
Best in #DB Client
Average in #DB Client
Top functions reviewed by kandi - BETA

kandi has reviewed HikariCP and discovered the below as its top functions. This is intended to give you an instant insight into HikariCP implemented functionality, and help decide if they suit your requirements.

  • Generate the proxy class .
  • Validates numerical values .
  • Shuts down the pool .
  • Sets a property on the target object .
  • Borrows a bag from the bag .
  • Set connection .
  • Parses the transaction isolation level name .
  • Returns an iterator over the elements in this list .
  • Creates a DataSource instance .
  • Shutdown the pool .

HikariCP Key Features

光 HikariCP・A solid, high-performance, JDBC connection pool at last.

Artifacts

copy iconCopydownload iconDownload
<dependency>
   <groupId>com.zaxxer</groupId>
   <artifactId>HikariCP</artifactId>
   <version>5.0.0</version>
</dependency>

:rocket: Initialization

copy iconCopydownload iconDownload
HikariConfig config = new HikariConfig();
config.setJdbcUrl("jdbc:mysql://localhost:3306/simpsons");
config.setUsername("bart");
config.setPassword("51mp50n");
config.addDataSourceProperty("cachePrepStmts", "true");
config.addDataSourceProperty("prepStmtCacheSize", "250");
config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048");

HikariDataSource ds = new HikariDataSource(config);

org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL "create table movie

copy iconCopydownload iconDownload
DROP TABLE IF EXISTS movie;
CREATE TABLE movie AS SELECT * FROM CSVREAD('classpath:movie.csv');

Invalid JDBC-Url: Driver org.postgresql.Driver claims to not accept jdbcUrl, jdbc:postgresql://${DB_ADDR_ALIAS}:${DB_PORT}/${DB_NAME}

copy iconCopydownload iconDownload
  backend:
    environment:
      DB_ADDR_ALIAS: '${DB_ADDR_ALIAS}'
      DB_PORT: '${DB_PORT}'
-----------------------
FROM maven:3.8.4-openjdk-17-slim AS build
ARG DB_ADDR_ALIAS
ARG DB_PORT
ARG DB_NAME
ARG DB_CLIENT_USER
ARG DB_CLIENT_PW
backend:
    container_name: taskitory-backend
    build:
      context: .
      args:
        - DB_ADDR_ALIAS=${DB_ADDR_ALIAS}
        - DB_PORT=${DB_PORT}
        - DB_NAME=${DB_NAME}
        - DB_CLIENT_USER=${DB_CLIENT_USER}
        - DB_CLIENT_PW=${DB_CLIENT_PW}
DB_ADDR_ALIAS=db
DB_PORT=5432
DB_NAME=Taskitory
DB_CLIENT_USER=client
DB_CLIENT_PW=*********
spring.datasource.url = jdbc:postgresql://${DB_ADDR_ALIAS}:${DB_PORT}/${DB_NAME}
spring.datasource.username = ${DB_CLIENT_USER}
spring.datasource.password = ${DB_CLIENT_PW}
-----------------------
FROM maven:3.8.4-openjdk-17-slim AS build
ARG DB_ADDR_ALIAS
ARG DB_PORT
ARG DB_NAME
ARG DB_CLIENT_USER
ARG DB_CLIENT_PW
backend:
    container_name: taskitory-backend
    build:
      context: .
      args:
        - DB_ADDR_ALIAS=${DB_ADDR_ALIAS}
        - DB_PORT=${DB_PORT}
        - DB_NAME=${DB_NAME}
        - DB_CLIENT_USER=${DB_CLIENT_USER}
        - DB_CLIENT_PW=${DB_CLIENT_PW}
DB_ADDR_ALIAS=db
DB_PORT=5432
DB_NAME=Taskitory
DB_CLIENT_USER=client
DB_CLIENT_PW=*********
spring.datasource.url = jdbc:postgresql://${DB_ADDR_ALIAS}:${DB_PORT}/${DB_NAME}
spring.datasource.username = ${DB_CLIENT_USER}
spring.datasource.password = ${DB_CLIENT_PW}
-----------------------
FROM maven:3.8.4-openjdk-17-slim AS build
ARG DB_ADDR_ALIAS
ARG DB_PORT
ARG DB_NAME
ARG DB_CLIENT_USER
ARG DB_CLIENT_PW
backend:
    container_name: taskitory-backend
    build:
      context: .
      args:
        - DB_ADDR_ALIAS=${DB_ADDR_ALIAS}
        - DB_PORT=${DB_PORT}
        - DB_NAME=${DB_NAME}
        - DB_CLIENT_USER=${DB_CLIENT_USER}
        - DB_CLIENT_PW=${DB_CLIENT_PW}
DB_ADDR_ALIAS=db
DB_PORT=5432
DB_NAME=Taskitory
DB_CLIENT_USER=client
DB_CLIENT_PW=*********
spring.datasource.url = jdbc:postgresql://${DB_ADDR_ALIAS}:${DB_PORT}/${DB_NAME}
spring.datasource.username = ${DB_CLIENT_USER}
spring.datasource.password = ${DB_CLIENT_PW}
-----------------------
FROM maven:3.8.4-openjdk-17-slim AS build
ARG DB_ADDR_ALIAS
ARG DB_PORT
ARG DB_NAME
ARG DB_CLIENT_USER
ARG DB_CLIENT_PW
backend:
    container_name: taskitory-backend
    build:
      context: .
      args:
        - DB_ADDR_ALIAS=${DB_ADDR_ALIAS}
        - DB_PORT=${DB_PORT}
        - DB_NAME=${DB_NAME}
        - DB_CLIENT_USER=${DB_CLIENT_USER}
        - DB_CLIENT_PW=${DB_CLIENT_PW}
DB_ADDR_ALIAS=db
DB_PORT=5432
DB_NAME=Taskitory
DB_CLIENT_USER=client
DB_CLIENT_PW=*********
spring.datasource.url = jdbc:postgresql://${DB_ADDR_ALIAS}:${DB_PORT}/${DB_NAME}
spring.datasource.username = ${DB_CLIENT_USER}
spring.datasource.password = ${DB_CLIENT_PW}
-----------------------
FROM maven:3.8.4-openjdk-17-slim AS build
ARG DATABASE_ADDR_ALIAS
ARG DATABASE_PORT
ARG DATABASE_NAME
ARG DATABASE_CLIENT_USER
ARG DATABASE_CLIENT_PW
COPY src /Taskitory/src
COPY pom.xml /Taskitory
RUN mvn -f /Taskitory/pom.xml clean package -DskipTests=true

How to Set config params in Slick-HikariCP

copy iconCopydownload iconDownload
mysqldb {
    driver = "com.mysql.cj.jdbc.Driver"
    url = "jdbc:mysql://localhost:3306"
    user = root
    password = root
    connectionTimeout = 10000
    queueSize = 50000
    minConnections = 20
    maxConnections = 40
    numThreads = 40
    idleTimeout = 85000 // should be less than maxLifetime
    maxLifetime = 90000 //time is in millsecods and should be less than database wait_timeout
}

Spring Boot Logging to a File

copy iconCopydownload iconDownload
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
java.util.logging.ConsoleHandler.formatter = org.springframework.boot.logging.java.SimpleFormatter
-----------------------
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
java.util.logging.ConsoleHandler.formatter = org.springframework.boot.logging.java.SimpleFormatter

error when connecting local mysql to gitlab ci/cdpipeline

copy iconCopydownload iconDownload
services:
  - docker:dind
  - mysql:8
url: jdbc:mysql://localhost:3306/usermanagementdb?createDatabaseIfNotExist=true
url: jdbc:mysql://mysql:3306/usermanagementdb?createDatabaseIfNotExist=true
-----------------------
services:
  - docker:dind
  - mysql:8
url: jdbc:mysql://localhost:3306/usermanagementdb?createDatabaseIfNotExist=true
url: jdbc:mysql://mysql:3306/usermanagementdb?createDatabaseIfNotExist=true
-----------------------
services:
  - docker:dind
  - mysql:8
url: jdbc:mysql://localhost:3306/usermanagementdb?createDatabaseIfNotExist=true
url: jdbc:mysql://mysql:3306/usermanagementdb?createDatabaseIfNotExist=true

Java IllegalArgumentException: MONTH

copy iconCopydownload iconDownload
@Column(columnDefinition = "DATE")

Calling javac the way Maven does

copy iconCopydownload iconDownload
stockapp-spring-boot (master)$ mvn clean compile 
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] stockapp-spring-boot                                               [pom]
[INFO] stockapp                                                           [jar]
[INFO] 
[INFO] -------------< it.raffaele.esposito:stockapp-spring-boot >--------------
[INFO] Building stockapp-spring-boot 1.2.2-SNAPSHOT                       [1/2]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ stockapp-spring-boot ---

 ...

[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ stockapp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 14 resources
[INFO] The encoding used to copy filtered properties files have not been set. This means that the same encoding will be used to copy filtered properties files as when copying other filtered resources. This might not be what you want! Run your build with --debug to see which files might be affected. Read more at https://maven.apache.org/plugins/maven-resources-plugin/examples/filtering-properties-files.html
[INFO] 
[INFO] --- maven-resources-plugin:3.2.0:copy-resources (Copy Vue frontend into Spring Boot target static folder) @ stockapp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 8 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ stockapp ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 27 source files to stockapp-spring-boot/stockapp/target/classes
[INFO] stockapp-spring-boot/stockapp/src/main/java/it/raffaele/esposito/app/service/MappingFunctions.java: stockapp-spring-boot/stockapp/src/main/java/it/raffaele/esposito/app/service/MappingFunctions.java uses or overrides a deprecated API.
[INFO] stockapp-spring-boot/stockapp/src/main/java/it/raffaele/esposito/app/service/MappingFunctions.java: Recompile with -Xlint:deprecation for details.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for stockapp-spring-boot 1.2.2-SNAPSHOT:
[INFO] 
[INFO] stockapp-spring-boot ............................... SUCCESS [  0.090 s]
[INFO] stockapp ........................................... SUCCESS [ 21.988 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  22.339 s
[INFO] Finished at: 2022-01-17T20:12:05+01:00
[INFO] ------------------------------------------------------------------------

nested exception is org.hibernate.exception.SQLGrammarException:could not execute query] with root cause java.sql.SQLException: Column 'id' not found

copy iconCopydownload iconDownload
@Query(value = "SELECT sweetholiday_user_house.start_rent_date, sweetholiday_user_house.end_rent_date FROM sweetholiday_user_house", nativeQuery = true)

List<Object[]> findAllReserved();
@Query(value = "SELECT user FROM sweetholiday_user_house user")
List<SweetholidayUserHouse> findAllReserved();
-----------------------
@Query(value = "SELECT sweetholiday_user_house.start_rent_date, sweetholiday_user_house.end_rent_date FROM sweetholiday_user_house", nativeQuery = true)

List<Object[]> findAllReserved();
@Query(value = "SELECT user FROM sweetholiday_user_house user")
List<SweetholidayUserHouse> findAllReserved();

Hibernate GenerationTarget encountered exception accepting command

copy iconCopydownload iconDownload
@Entity
@Table(name = "ARTICLES", schema = "NEWS_SCHEMA")
@Getter
@Setter
@NoArgsConstructor
public class Article {
    @Id
    @Column(name = "ID")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;

    @Column(name = "TITLE")
    private String title;

    @Column(name = "CONTENT")
    private byte[] content;

    @Column(name = "CATEGORY_ID")
    int categoryId;

    
    @ManyToMany(cascade = { CascadeType.ALL })
    @JoinTable(
        name = "Article_Authors", 
        joinColumns = { @JoinColumn(name = "Artical_id") }, 
        inverseJoinColumns = { @JoinColumn(name = "Author_id") }
    private List<Author> author;


    @ManyToMany(cascade = { CascadeType.ALL })
    @JoinTable(
        name = "Article_Categories", 
        joinColumns = { @JoinColumn(name = "Artical_id") }, 
        inverseJoinColumns = { @JoinColumn(name = "Category_id") }
    private List<Category> category;

    // getter and setter
}
@Entity
@Table(name = "AUTHORS",schema = "NEWS_SCHEMA")
public class Author {
    @Id
    @Column(name = "ID")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;

    @Column(name = "NAME")
    private String name;

    @Column(name = "SURNAME")
    private String surname;

    @Column(name = "DATE_OF_BIRTH")
    private Date dob;

    @OneToMany(mappedBy = "author")
    private List<Article> articles;

    // getter and setter
}
@Entity
@Table(name = "CATEGORIES", schema = "NEWS_SCHEMA")
@Getter
@Setter
@NoArgsConstructor
public class Category {
    @Id
    @Column(name = "ID")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;

    @Column(name = "NAME")
    private String name;

    //categories -> название листа в Article
    @ManyToMany(mappedBy = "category")
    private List<Article> articles;

    // getter and setter
}
-----------------------
@Entity
@Table(name = "ARTICLES", schema = "NEWS_SCHEMA")
@Getter
@Setter
@NoArgsConstructor
public class Article {
    @Id
    @Column(name = "ID")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;

    @Column(name = "TITLE")
    private String title;

    @Column(name = "CONTENT")
    private byte[] content;

    @Column(name = "CATEGORY_ID")
    int categoryId;

    
    @ManyToMany(cascade = { CascadeType.ALL })
    @JoinTable(
        name = "Article_Authors", 
        joinColumns = { @JoinColumn(name = "Artical_id") }, 
        inverseJoinColumns = { @JoinColumn(name = "Author_id") }
    private List<Author> author;


    @ManyToMany(cascade = { CascadeType.ALL })
    @JoinTable(
        name = "Article_Categories", 
        joinColumns = { @JoinColumn(name = "Artical_id") }, 
        inverseJoinColumns = { @JoinColumn(name = "Category_id") }
    private List<Category> category;

    // getter and setter
}
@Entity
@Table(name = "AUTHORS",schema = "NEWS_SCHEMA")
public class Author {
    @Id
    @Column(name = "ID")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;

    @Column(name = "NAME")
    private String name;

    @Column(name = "SURNAME")
    private String surname;

    @Column(name = "DATE_OF_BIRTH")
    private Date dob;

    @OneToMany(mappedBy = "author")
    private List<Article> articles;

    // getter and setter
}
@Entity
@Table(name = "CATEGORIES", schema = "NEWS_SCHEMA")
@Getter
@Setter
@NoArgsConstructor
public class Category {
    @Id
    @Column(name = "ID")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;

    @Column(name = "NAME")
    private String name;

    //categories -> название листа в Article
    @ManyToMany(mappedBy = "category")
    private List<Article> articles;

    // getter and setter
}
-----------------------
@Entity
@Table(name = "ARTICLES", schema = "NEWS_SCHEMA")
@Getter
@Setter
@NoArgsConstructor
public class Article {
    @Id
    @Column(name = "ID")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;

    @Column(name = "TITLE")
    private String title;

    @Column(name = "CONTENT")
    private byte[] content;

    @Column(name = "CATEGORY_ID")
    int categoryId;

    
    @ManyToMany(cascade = { CascadeType.ALL })
    @JoinTable(
        name = "Article_Authors", 
        joinColumns = { @JoinColumn(name = "Artical_id") }, 
        inverseJoinColumns = { @JoinColumn(name = "Author_id") }
    private List<Author> author;


    @ManyToMany(cascade = { CascadeType.ALL })
    @JoinTable(
        name = "Article_Categories", 
        joinColumns = { @JoinColumn(name = "Artical_id") }, 
        inverseJoinColumns = { @JoinColumn(name = "Category_id") }
    private List<Category> category;

    // getter and setter
}
@Entity
@Table(name = "AUTHORS",schema = "NEWS_SCHEMA")
public class Author {
    @Id
    @Column(name = "ID")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;

    @Column(name = "NAME")
    private String name;

    @Column(name = "SURNAME")
    private String surname;

    @Column(name = "DATE_OF_BIRTH")
    private Date dob;

    @OneToMany(mappedBy = "author")
    private List<Article> articles;

    // getter and setter
}
@Entity
@Table(name = "CATEGORIES", schema = "NEWS_SCHEMA")
@Getter
@Setter
@NoArgsConstructor
public class Category {
    @Id
    @Column(name = "ID")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;

    @Column(name = "NAME")
    private String name;

    //categories -> название листа в Article
    @ManyToMany(mappedBy = "category")
    private List<Article> articles;

    // getter and setter
}

Reactor Kafka health check in a Spring webflux app

copy iconCopydownload iconDownload
.doOnTerminate(() -> terminated = true)

Community Discussions

Trending Discussions on HikariCP
  • org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL &quot;create table movie
  • Invalid JDBC-Url: Driver org.postgresql.Driver claims to not accept jdbcUrl, jdbc:postgresql://${DB_ADDR_ALIAS}:${DB_PORT}/${DB_NAME}
  • How to reference a project definition in a parent build.sbt file?
  • How to Set config params in Slick-HikariCP
  • Spring Boot Logging to a File
  • Why is this Spring (Kotlin) many to many relation created with hibernate using postgresql as db crashing?
  • error when connecting local mysql to gitlab ci/cdpipeline
  • Java IllegalArgumentException: MONTH
  • Calling javac the way Maven does
  • FBDriver reporting warnings I can't figure out how to fix
Trending Discussions on HikariCP

QUESTION

org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL &quot;create table movie

Asked 2022-Apr-03 at 09:39

I've a spring boot application which run sql on H2 to create database table during startup. The project is in github here.

I've Entity called Movie.java

The sql that I'm running is below and on github here -

DROP TABLE IF EXISTS "movie";
CREATE TABLE "movie" AS SELECT * FROM CSVREAD('classpath:movie.csv');

The csv file that I'm inserting is here

id,title,year,rating,genre
1,The Shawshank Redemption,1994,9.3,DRAMA
2,The godfather,1972,9.2,DRAMA
3,Pulp Fiction,1994,8.9,CRIME
4,The good the bad and the ugly,1966,8.8,WESTERN
5,Inception,2010,8.8,ACTION
6,Se7en,1995,8.6,CRIME
7,City of god,2002,8.06,CRIME
8,Django unchained,2012,8.4,WESTERN
9,Oldboy,2003,8.4,ACTION

When I run the spring application I get below error -

org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL "create table movie (id integer not null, genre varchar(255), rating double not null, title varchar(255), year integer not null, primary key (id))" via JDBC Statement at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:67) ~[hibernate-core-5.6.7.Final.jar:5.6.7.Final] at org.hibernate.tool.schema.internal.SchemaCreatorImpl.applySqlString(SchemaCreatorImpl.java:458) ~[hibernate-core-5.6.7.Final.jar:5.6.7.Final] at org.hibernate.tool.schema.internal.SchemaCreatorImpl.applySqlStrings(SchemaCreatorImpl.java:442) ~[hibernate-core-5.6.7.Final.jar:5.6.7.Final] at org.hibernate.tool.schema.internal.SchemaCreatorImpl.createFromMetadata(SchemaCreatorImpl.java:325) ~[hibernate-core-5.6.7.Final.jar:5.6.7.Final] at org.hibernate.tool.schema.internal.SchemaCreatorImpl.performCreation(SchemaCreatorImpl.java:169) ~[hibernate-core-5.6.7.Final.jar:5.6.7.Final] at org.hibernate.tool.schema.internal.SchemaCreatorImpl.doCreation(SchemaCreatorImpl.java:138) ~[hibernate-core-5.6.7.Final.jar:5.6.7.Final] at org.hibernate.tool.schema.internal.SchemaCreatorImpl.doCreation(SchemaCreatorImpl.java:124) ~[hibernate-core-5.6.7.Final.jar:5.6.7.Final] at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:168) ~[hibernate-core-5.6.7.Final.jar:5.6.7.Final] at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:85) ~[hibernate-core-5.6.7.Final.jar:5.6.7.Final] at org.hibernate.internal.SessionFactoryImpl.(SessionFactoryImpl.java:335) ~[hibernate-core-5.6.7.Final.jar:5.6.7.Final] at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:471) ~[hibernate-core-5.6.7.Final.jar:5.6.7.Final] at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1498) ~[hibernate-core-5.6.7.Final.jar:5.6.7.Final] at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:58) ~[spring-orm-5.3.17.jar:5.3.17] at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) ~[spring-orm-5.3.17.jar:5.3.17] at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) ~[spring-orm-5.3.17.jar:5.3.17] at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396) ~[spring-orm-5.3.17.jar:5.3.17] at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341) ~[spring-orm-5.3.17.jar:5.3.17] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863) ~[spring-beans-5.3.18.jar:5.3.18] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) ~[spring-beans-5.3.18.jar:5.3.18] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[spring-beans-5.3.18.jar:5.3.18] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.18.jar:5.3.18] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.18.jar:5.3.18] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.18.jar:5.3.18] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.18.jar:5.3.18] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.18.jar:5.3.18] at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154) ~[spring-context-5.3.18.jar:5.3.18] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:908) ~[spring-context-5.3.18.jar:5.3.18] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.18.jar:5.3.18] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:740) ~[spring-boot-2.6.6.jar:2.6.6] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:415) ~[spring-boot-2.6.6.jar:2.6.6] at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) ~[spring-boot-2.6.6.jar:2.6.6] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1312) ~[spring-boot-2.6.6.jar:2.6.6] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) ~[spring-boot-2.6.6.jar:2.6.6] at com.grpcflix.movie.MovieApplication.main(MovieApplication.java:9) ~[main/:na] Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "create table movie (id integer not null, genre varchar(255), rating double not null, title varchar(255), []year integer not null, primary key (id))"; expected "identifier"; SQL statement: create table movie (id integer not null, genre varchar(255), rating double not null, title varchar(255), year integer not null, primary key (id)) [42001-210] at org.h2.message.DbException.getJdbcSQLException(DbException.java:521) ~[h2-2.1.210.jar:2.1.210] at org.h2.message.DbException.getJdbcSQLException(DbException.java:496) ~[h2-2.1.210.jar:2.1.210] at org.h2.message.DbException.getSyntaxError(DbException.java:265) ~[h2-2.1.210.jar:2.1.210] at org.h2.command.Parser.readIdentifier(Parser.java:5759) ~[h2-2.1.210.jar:2.1.210] at org.h2.command.Parser.parseTableColumnDefinition(Parser.java:9355) ~[h2-2.1.210.jar:2.1.210] at org.h2.command.Parser.parseCreateTable(Parser.java:9298) ~[h2-2.1.210.jar:2.1.210] Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "create table movie (id integer not null, genre varchar(255), rating double not null, title varchar(255), []year integer not null, primary key (id))"; expected "identifier"; SQL statement:

at org.h2.command.Parser.parseCreate(Parser.java:6779) ~[h2-2.1.210.jar:2.1.210] at org.h2.command.Parser.parsePrepared(Parser.java:746) ~[h2-2.1.210.jar:2.1.210] at org.h2.command.Parser.parse(Parser.java:674) ~[h2-2.1.210.jar:2.1.210] at org.h2.command.Parser.parse(Parser.java:644) ~[h2-2.1.210.jar:2.1.210] at org.h2.command.Parser.prepareCommand(Parser.java:551) ~[h2-2.1.210.jar:2.1.210] at org.h2.engine.SessionLocal.prepareLocal(SessionLocal.java:615) ~[h2-2.1.210.jar:2.1.210] at org.h2.engine.SessionLocal.prepareCommand(SessionLocal.java:553) ~[h2-2.1.210.jar:2.1.210] at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1116) ~[h2-2.1.210.jar:2.1.210] at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:237) ~[h2-2.1.210.jar:2.1.210] at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:223) ~[h2-2.1.210.jar:2.1.210] at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:94) ~[HikariCP-4.0.3.jar:na] at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java) ~[HikariCP-4.0.3.jar:na] at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:54) ~[hibernate-core-5.6.7.Final.jar:5.6.7.Final] ... 33 common frames omitted

I think the error is columns are in different order than it is defined in the entity from the SQL to create table.

create table movie (id integer not null, genre varchar(255), rating double not null, title varchar(255), [*]year integer not null, primary key (id))

Any idea how to ix this error?

ANSWER

Answered 2022-Apr-03 at 09:39

The main problem is probably "movie" as table-name incl the "

So this should work

schema.sql:

DROP TABLE IF EXISTS movie;
CREATE TABLE movie AS SELECT * FROM CSVREAD('classpath:movie.csv');

here is a working basic example: example on github

Note for the example

  • schema.sql for initialization of the DB howto.data-initialization
  • spring.jpa.hibernate.ddl-auto=none to disable Hibernate automatic schema creation

Source https://stackoverflow.com/questions/71723037

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install HikariCP

You can download it from GitHub, Maven.
You can use HikariCP like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the HikariCP component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

Support

Google discussion group HikariCP here, growing FAQ.

DOWNLOAD this Library from

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

Explore Related Topics

Share this Page

share link
Compare DB Client Libraries with Highest Support
Compare DB Client Libraries with Permissive License
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

  • © 2022 Open Weaver Inc.