Skip to content
Advertisement

Tag: postgresql

Use a list of strings in IN clause with JDBI

I’m using JDBI / Dropwizard for a project and would like to run some simple queries. I have a query like so: private static final String GET_STUFF = “SELECT * FROM myTable WHERE state IN (:desiredState)” I bind the variable in my method like so: However, I get the following error when running: I’m passing in states as an ArrayList

Exception : org.postgresql.util.PSQLException: ERROR: syntax error at or near “call”

I am working on a application in which hibernate and postgresql and giving the following error org.postgresql.util.PSQLException: ERROR: syntax error at or near “call” Can someone tell me where I am going wrong. I am using Postgres 9.4. EmployeeController Employee.java Class Answer I was using a wrong dailect earlier by using the dailect org.hibernate.dialect.PostgreSQLDialect with postgres 9.4 the application is

How to specify UTC timezone for Spring Boot JPA Timestamp

Environment Spring Boot Starter Data JPA 1.4.2 Eclipselink 2.5.0 Postgresql 9.4.1211.jre7 Problem I am building a Spring Boot microservice that shares a Postgresql database with a different service. The database gets initialized externally (out of our control) and the datetime column type used by the other service is timestamp without time zone. Therefore, since I want all dates on the

How to use Postgres JSONB datatype with JPA?

Im not finding a way to map the JSON and JSONB datatypes from PostgreSQL using JPA (EclipseLink). Is some one using this datatypes with JPA and can give me some working examples? Answer All the answers helped me to reach the final solution that is ready for JPA and not EclipseLink or Hibernate specifically.

org.hibernate.internal.util.config.ConfigurationException: Could not locate cfg.xml resource [/HibernateTest/src/hibernate.cfg.xml]

I am trying to connect to Postgresql9.1 in ubuntu with pgadmin3. My Pgadmin3 GUI tool does not give any option to create tables by right clicking the database, but it is available in some videos I saw. Therefore, I used terminal to create the database and it showed up in pgadmin3. my file structure My Userdetails file My HibernateCaller file

How do I configure PostgreSQL with Grails 3.0?

I am using IntelliJ IDEA 15.0.2 as an IDE. I have created a Grails 3.0 application and changed it a bit to configure PostgreSQL. Here is my dataSource: And in my build.gradle I added runtime “postgresql:postgresql:9.4-1207.jdbc4”. But that gives errors when I run: What have I missed? Answer Data source Build Config Change the jre number according to your db

Mapping java.lang.String type to Postgres JSON Type

My question is related to the following question Mapping postgreSQL JSON column to Hibernate value type and although the answer works when I test passing a string to psql in postgres it doesn’t work when passing a string from my Java code. I am using MyBatis to map sql to the postgres database via Spring injection. Here is my Java

Advertisement