Skip to content

Tag: jdbc

Using PostgreSQL COPY

I’m using JMeter for insert summary data file to PostgreSQL. I tried copy instead of COPY but I’m getting error at copy syntax. I found out COPY is for only server-side, so I us copy for client-side. Here is my query Here is the error: org.postgresql.util.PSQLException: ERROR: syntax error at or n…

JPA Batch inserts with non auto generated id

im triying to batch insert a few Million Entitys. The Batch insert kind of works, but my programm executes a few JDBC Statements in the background which i dont want. } my Repository: my Entity: my JPA Settings: The Batch Insert Does work, but if i try to Upload 100 Entitys i have 33 JDBC Statements which are …

JDBC, Prepared Statement getInt() returns 0

In my DB every question has a valid questionID (primary Key) and categoryID (foreign Key to category table). The problem is: in the Result Set for every question both IDs are 0 instead of what’s written in the DB. All other arguments are filled out correctly. Edit 1 Here is the original code (in the pos…

Conditional UPDATE MariaDB (MySQL)

Code: UPDATE COMPANY SET id=’21’ WHERE id=’20’; Error: SQLException: Duplicate entry ’21’ for key ‘PRIMARY’ I want to UPDATE the primary key field in this case it’s called ‘id’ to another value …