Skip to content
Advertisement

Tag: sql

Combine JPA Query annotation with Oracle sample method

i am trying to pass a parameter into a JPA query Example code But i get an error because of the sample(:percentile). If i just hardcode a number in there it works but not with a param. Is there a way to escape the brackets or something similar? Thx Answer The error is on the following part Unfortunately it does

How to extract JSON from sql query?

My query looks like this: I want to retry the messages that failed, but the message is a json string and the offset is a regular string. I need to extract the json messages and the offset strings and then iterate through each row. How would I do this? RIght now I am doing something like this: //Service buildQueryResult() simply

JPQL query that give me the highest value

I’m trying to do a JPQL query that give me the highest PK of the PKs in my table (https://drive.google.com/file/d/1_kaklkKdCbhT0-byqCtz6HgfluKKp8J-/view?usp=sharing). Here is my query : The error says that the syntax of my query is wrong. Can someone please help me ? Thank you for your help 🙂 Answer Thank you for your comments ! It allowed me to solve

Date conversion format Java to DB different format

I’m making a code in java that executes an Oracle database procedure The format I have to put there in the procedure when I run through the database is dd/MM/yyyy. I have to send this date from my java code using a CallebleStatement setDate with the date yyyy-MM-dd (which is the Date format in java) When this CallebleStatement is executed,

JPA SpringBoot – Unable to Save New Entity to Database

I am attempting to add (save) a “User” to my SQL database through my Spring application (The @GetMapping requests currently work). I recently added the two annotations @CreationTimeStamp and @UpdateTimeStamp in my entity class…the version without those two annotations would produce the same errors as shown. I am testing the API with Postman-here is my Users entity class: my UsersDTO

Query did not return a unique result

This is the query I have written: This is the output I am getting from the database: id versions 101 0.0 101 1.0 101 2.0 101 3.0 In my application, I am storing this result in but it gives an error saying “query did not return a unique result” How can I store this result? which data structure could I

Advertisement