On Wed, Jan 13, 2016 at 12:33 AM, Ben Hood <0x6e6...@gmail.com> wrote:
> java.time.format.DateTimeParseException: Text '2014-04-01T10:11:10.15
> +0:00' could not be parsed at index 22
> at 
> java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:1949)
> at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1851)
> at java.time.OffsetDateTime.parse(OffsetDateTime.java:402)
> at java.time.OffsetDateTime.parse(OffsetDateTime.java:387)
> at org.jooq.impl.DefaultBinding.offsetDateTime(DefaultBinding.java:1496)
> at org.jooq.impl.DefaultBinding.get(DefaultBinding.java:1336)
> at 
> org.jooq.impl.CursorImpl$CursorIterator$CursorRecordInitialiser.setValue(CursorImpl.java:1640)

I ended up solving this issue by getting JOOQ to build the SQL and
JDBC to execute and deserialize the data:

db.executeVoid(ctx ->  {

  String query = ctx.
      select(CDR_IDENTIFIERS.EFFECTIVE).
      from(CDR_IDENTIFIERS).
      getSQL();

  ctx.connection(c -> {
    PreparedStatement ops = c.prepareStatement(query);
    ResultSet rs = ops.executeQuery();
    while (rs.next()) {
      TIMESTAMPTZ ts = rs.getObject(1, TIMESTAMPTZ.class);
      OffsetDateTime odt = converter.from(ts);
      // do something with this data
    }
  });

  // do other stuff in the same TX with the JOOQ DSL

});

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jooq-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to