Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
3.0.5
-
None
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?