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

How to LOAD DATA INFILE since 3.0.0?

    XMLWordPrintable

    Details

      Description

      Please provide samples how to migrate `MariaDbStatement.setLocalInfileInputStream` from 2.7.5 to 3.x

      The docs still show the deprecated class:
      https://github.com/microsoft/mariadb-connector-j/blob/master/documentation/use-mariadb-connector-j-driver.creole#jdbc-api-implementation-notes

      The old way was neat for just loaded CSV data from *memory* without an intermediate file into a database, as follows:

              PreparedStatement st = con.prepareStatement("LOAD DATA LOCAL INFILE '' INTO TABLE my_table FIELDS TERMINATED BY ';'");
       
              if (st.isWrapperFor(MariaDbStatement.class)) {
                  MariaDbStatement mariaDbStatement = statement.unwrap(MariaDbStatement.class);
                  mariaDbStatement.setLocalInfileInputStream(new ByteArrayInputStream(csv.getBytes()));
              } 
       
              st.executeBatch();
      

      How can the same be achieved since MariaDbStatement was dropped?

        Attachments

          Activity

            People

            Assignee:
            diego dupin Diego Dupin
            Reporter:
            membersound member sound
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Git Integration

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