I need to take values from a database and put them into a List<Long>. I made a native query but it doesn’t work correctly. Here’s a picture of the column on my database: I need to count the same statuses (“W” and “I” represent the same status but are represented by an…
Tag: sql
Inject Date or LocalDate into SQL query via jdbcTemplate.query?
I had a simple query like: I injected a LocalDate into query: Everything worked fine. After I moved my project with IDE to another PC, without any alterations, it started to throw exception: I can use a workaround via converting LocalDate to Date: but it does not seem right to me: I want to know the reason. W…
Are all exceptions throw from Jdbi of type JdbiException?
It states here: https://jdbi.org/apidocs/org/jdbi/v3/core/JdbiException.html that JdbiException is the Base unchecked exception for exceptions thrown from jdbi. However, if I’m calling the withHandle method with various different callbacks: the docs state that it throws X extends Exception (rather than …
Connecting 3 tables with hibernate / spring-boot
I have problem understanding how to connect 3 tables with spring-boot / hibernate. Tables are: Users, Technologies, Categories Every user has all of the 10 categories but inside this categories they can save one or more technologies. Each technology can be listed in several different categories. I have a code…
CRATE db tables are causing an error when upgrading to CRATE:4.3.4 from CRATE:4.2.7
Facing the below error while restoring snapshots or upgrade cratedb to a higher version from 4.2.7 to 4.3.4 Below is the sample table creation schema. As field3 is the dynamic object, it’ll allow adding more attributes into it. So, now after data is inserted into the table the current schema is as follo…
executeUpdate() returns always 1 with MERGE statement
ExecuteUpdate() is always returning 1. Pls suggest and appreciate any input. Procedure: Java code: stmt.executeUpdate() – always returns 1, even though insertion happens only once. Appreciate any inputs on this. Ideally, if there are no insertions or errors, it should return 0 or any exception trace. Pl…
How can I reference a view in the entity? (Spring Boot)
I have a question. Of course, I have previously looked on the Internet and searched for the solution. Unfortunately, I have not found a solution. I have a Spring Boot application that processes the information from customers. But this application should not point to a table as usual but to a view that request…
SQL Error Invalid column when using java servlet [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 1 y…
How to parse a Clickhouse-SQL statement using ANTRL4?
Objective : Add an additional WHERE clause to any given Clickhouse statement. I’m using the following Antlr grammars to generate Java classes for a lexer & parser. Lexer grammar https://github.com/ClickHouse/ClickHouse/blob/master/utils/antlr/ClickHouseLexer.g4 Parser grammar https://github.com/Clic…
Seeding Initial Data – Spring Boot with data.sql
data.sql is executed before JPA entities are created and it creates the error that the table is not found. can anyone help me with it? I have seen the same question in this link Spring Boot – Loading Initial Data but the question is not answered. Answer This is a normal and wanted behaviour from Springb…