Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-1195

JDBC throw exception on bad DATE

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 2.2.5
    • None
    • JDBC compatibility
    • None

    Description

      First, I create a simple table with a DATE column:

      create table t (a date);

      insert into t (a) values(300); – bad date here

      Then I select from it without any type:

      select * from t; – in the command line returns 2000-02-29

      But if I use ResultSet.getObject(index, class) JDBC, I get:

      LocalDate v = rs.getObject(1, LocalDate.class);

      java.sql.SQLException: 2000-03-00 cannot be parse as LocalDate (format is "yyyy-MM-dd" for data type "DATE")
      at org.mariadb.jdbc.internal.com.read.resultset.rowprotocol.TextRowProtocol.getInternalLocalDate(TextRowProtocol.java:947)
      at org.mariadb.jdbc.internal.com.read.resultset.SelectResultSet.getObject(SelectResultSet.java:1340)}}

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            valarcon Vladimir Alarcon
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.