Skip to content
Advertisement

Tag: h2

H2 DB Incorrect special characters sorting

I’m trying to sort column data in my h2 database, but it isn’t correct. I think that change of collation may help. I tried to set collation in datasource url in many ways e.g.: spring.datasource.url = jdbc:h2:mem:testdb;COLLATION=’ENGLISH’ spring.datasource.url = jdbc:h2:mem:testdb;SET COLLATION=’EN” spring.datasource.url = jdbc:h2:mem:testdb;SET COLLATION ENGLISH STRENGTH PRIMARY’ And I’m still have an syntax error like this Syntax error in

Java PreparedStatement preserve table name casing

I have this Java snippet, running inside a WildFly server backed by MariaDB: which gives me the following exception: So, apparentally, it decided to uppercase the table name, which I don’t want. How can I turn it off? Answer That is not possible, SQL dialects are – usually – case insensitive by default, but store the table name in uppercase

Syntax error in SQL statement “CREATE EXTENSION[*] IF NOT EXISTS UUID_OSSP “

I’m trying to create h2 DB schema. Here is my sql And I get an error Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement “CREATE EXTENSION[*] IF NOT EXISTS UUID_OSSP “; expected “OR, FORCE, VIEW, ALIAS, SEQUENCE, USER, TRIGGER, ROLE, SCHEMA, CONSTANT, DOMAIN, TYPE, DATATYPE, AGGREGATE, LINKED, MEMORY, CACHED, LOCAL, GLOBAL, TEMP, TEMPORARY, TABLE, SYNONYM, PRIMARY, UNIQUE, HASH, SPATIAL, INDEX”;

Cannot use setArray JDBC (integer) with H2 Database

I want to put an array of integers in my jdbc query with H2 database. But doest not work, I am getting this exception : org.h2.jdbc.JdbcSQLException: Data conversion error converting “(1,2,3)”; SQL statement: I am using H2 database. Can you help me please? Answer Using my JDBC utilities to work with JDBC IN array parameters easily: 1. If Maven, add

hibernate h2 embeddable list expected “identifier”

I’m trying to associate a list of function (whom Embeddable) within my Employee Entity and H2 seems unhappy with this saying that it expected an “identifier” Caused by: org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement ” CREATE TABLE EMPLOYEE_FUNCTIONS ( EMPLOYEE_EMPLOYEEID VARCHAR(255) NOT NULL, ACTIVE BOOLEAN NOT NULL, DEPARTMENTNUMBER INTEGER NOT NULL, DESCRIPTION VARCHAR(255), ORDER[*] INTEGER NOT NULL ) “; expected

Cannot import org.h2.server.web.WebServlet

I am trying to configure my spring boot application to use h2 console. I found some articles and all of them use webServlet. But I can not import the class although I have h2 dependency added in my pom.xml. I get this error message can not resolve the symbol WebServlet. My import line Below is my pom.xml and my application.properties

H2 database error: Database may be already in use: “Locked by another process”

I am trying to use the H2 database from a Java application. I created the database and its tables through the H2 Console and then I try to connect from Java using However I receive the following error: Exception in thread “main” org.h2.jdbc.JdbcSQLException: Database may be already in use: “Locked by another process”. Possible solutions: close all other connection(s); use

Load CSV file located in the classpath for H2 Database

For tests purposes, I want to create and fill some tables using SQL scripts as well as CSV files. So I created a SQL script like this one: The foo.csv file exists, and is located in src/test/resources. When this script is run on Eclipse (where src/test/resources is defined as a source directory and thus is included in the classpath), I

Advertisement