https://bugs.documentfoundation.org/show_bug.cgi?id=153678

--- Comment #4 from [email protected] ---
> This page 
> https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/jdbc_42.html
> doesn't mention them. Did I miss something?

I do not know exactly the version of JDBC which included these two new types
but they can be found in the documentation of Java 8 or JDBC 4.2:
-
https://docs.oracle.com/javase/8/docs/api/constant-values.html#java.sql.Types.TIME_WITH_TIMEZONE
-
https://docs.oracle.com/javase/8/docs/api/constant-values.html#java.sql.Types.TIMESTAMP_WITH_TIMEZONE

But I know that the databases supporting the system versioning (or temporal
table) like HsqlDB since its version 2.5.X uses two columns (ROWSTART and
ROWEND) of type TIMESTAMP_WITH_TIMEZONE to carry out this management.

> I suppose we need more than quote the new types, for example how to deal with 
> them for
> each driver (see connectivity/source/drivers/ subdirs)

In Java 9 (and later) the methods to assign a column (setter) of one of these
two types are:
- setObject(Interger, java.time.OffsetDateTime or OffsetTime)
- setString(Interger, String)
- setTimestamp(Interger, java.sql.Timestamp, java.util.Calendar)
  setTime(Interger, java.sql.Time or Time, java.util.Calendar)

The methods to get a column (getter):
- java.time.OffsetDateTime or OffsetTime getObject(Interger)
- String getString(Interger)
- java.sql.Timestamp getTimestamp(Interger, java.util.Calendar)
  java.sql.Time getTime(Interger, java.util.Calendar)

The getter and setter getObject and setObject are normally the recommended
methods for this type of data. And it is possible to easily convert
java.time.OffsetDateTime to a com.sun.star.util.DateTimeWithTimezone (idem for
java.time.OffsetTime) for and vice versa.

The getter and setters getString and setString are the simplest methods. If the
driver (jdbcDriverOOo) maps these two new types to type
com.sun.star.sdbc.DataType.VARCHAR then Base is able to display and update
columns of this type. This display will depend on the conversion performed by
the database level.

The getter and setter getTimestamp / setTimestamp (and getTime / setTime) seem
deprecated.

On the other hand, for the creation of a table (CREATE TABLE ...) the type
TIMESTAMP WITH TIMEZONE requires lines of code dedicated to this type since the
precision must be inserted in the type: ie: TIMSTAMP(9) WITH TIME ZONE...

Hoping to have answered your questions.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to