You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@iotdb.apache.org by "任宇华 (Jira)" <ji...@apache.org> on 2023/02/07 07:05:00 UTC

[jira] [Assigned] (IOTDB-5487) Fix the problem that the timestamp is "null" when using jdbc

     [ https://issues.apache.org/jira/browse/IOTDB-5487?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

任宇华 reassigned IOTDB-5487:
--------------------------

    Assignee: 任宇华

> Fix the problem that the timestamp is "null" when using jdbc
> ------------------------------------------------------------
>
>                 Key: IOTDB-5487
>                 URL: https://issues.apache.org/jira/browse/IOTDB-5487
>             Project: Apache IoTDB
>          Issue Type: New Feature
>          Components: Client/JDBC
>            Reporter: 任宇华
>            Assignee: 任宇华
>            Priority: Major
>         Attachments: image-2023-02-07-15-02-01-340.png
>
>
> 代码:
> while (resultSet.next()) {
> for (int i = 1; i <= columnCount; i++) {
> int ct = metaData.getColumnType(i);
> if (ct == Types.TIMESTAMP) {
> Timestamp rValue = resultSet.getTimestamp(i);
> if (resultSet.wasNull()) {
> System.out.println(i + "is null");
> } else {
> System.out.println(i + "value:" + rValue.toString());
> }
> } else {
> String rValue = resultSet.getString(i);
> if (resultSet.wasNull()) {
> System.out.println(i + "is null");
> } else {
> System.out.println(i + "value:" + rValue);
> }
> }
> }
> }
> !image-2023-02-07-15-02-01-340.png!
> Because the last value is null, the lastReadWasNull field is true. An error occurred when using wasNull method to judge.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)