Skip to content

Tag: postgresql

PostgreSQL’s JSONB data type with Hibernate: Error creating bean with name ‘entityManagerFactory’ defined in class path resource-Unable to load class

Now I learn about nested jsons and geojson and how to save them in PostgreSQL as JsonB directly in database and before starting. Inspiration source: Error I get when running the app: Here is the Main Entity: Here is the geojson(nested json) I want to save as Jsonb in a column in database: Here is the implementation of Usertype

Spring boot won’t connect to Postgres database

I am trying to learn Spring Boot with a tutorial. I have the code and the database, but I keep getting a Hibernate ERROR whenever I try to connect the two… This is the Error I get: I have the dependency set up in my pom.xml: The StudentService And the StudentController class Unfortunately I have no idea what’s the

How to generate .dot file using Schemacrawler

Using schemcrawler I’ve generated html file But I want to have an output in .dot file that contains diagram, node, graph, edge etc.. So how can I do it using my code or maybe some another way to do it with Java? Answer Simply change the output format from TextOutputFormat.html to DiagramOutputFormat.scdot. Sualeh Fatehi, SchemaCrawler

Parametrized query request postgresql

I want to get data from my DB where is LocalDateTime equals to LocalDateTime in get request. Timeslot table code: Controller code: But when I did this request result in console is: org.postgresql.util.PSQLException: ERROR: syntax error at end of input. How do i change sql request code to fix this error? Should I use PrepareStatement or something else? Answer I

ValidationFailedException after Liquibase update to 4.9.1

We were using older Liquibase that we now wanted to update to 4.9.1 due to vulnerabilities in older versions. However, now at least one of our old migrations fails with ValidationFailedException: The constraintName is missing from <addPrimaryKey>. However, it worked just fine with the older versions. How can we fix this? If we change the migration, it changes its checksum

Result set is empty but query works in Postgres

I’m trying to get some results from Postgres into my Java application. As of now, I always used PreparedStatements with ResultSets to get data from my database in memory. But today my code refuses to work, although I use the same code as usual. Here is my piece of code: Here is the log: The ArrayList explicitCollectionsIds is empty/not filled

Is it possible to map jooq Record from string

I have a case where I need to map jooq Record from json to class instance. We have used our own mapper for this in the past, but underlying table had only basic types so it was working fine. Now we have a need to map Postgres interval type to jooq YearToSecond and it is not working anymore. I was