Insert “daterange” field value into PostgreSQL table through JDBC
问题 I have a table in PostgreSQL(9.3) with daterange field type. I can select this field like a String with JDBC, but I cannot Insert it in a table. What I've tried: PreparedStatement stm = conn.prepareStatement("insert into mytable (my_daterange_field) values (?)"); stm.setString(1, "[2014-01-02,2014-01-04]"); int i = stm.executeUpdate(); and I got: Exception in thread "main" org.postgresql.util.PSQLException: ERROR: column "my_daterange_field" is of type daterange but expression is of type