I'm having quite a bit of trouble preparing this SQL statement for PostgreSQL using JDBI. I get an error when trying to apply a Java Long to a SQL column type of bigint. When I execute the following:
Long valLong = System.currentTimeMillis();
handle.createQuery("INSERT INTO table (valCol)"
+ "VALUES (:val) "
+ "RETURNING *")
.bind("val", valLong)
.map(Mapper.instance)
.list());
I get the following error:
org.postgresql.util.PSQLException: ERROR: column "val" is of type bigint but expression is of type character varying
Any help is extremely appreciated!
valLongdefined in Java? – a_horse_with_no_name 18 hours ago