I\'m trying to insert some Binary data into a MySQL database without using prepared statements. The reason for this is that I concatenate thousands of statements into a sing
Have you tried to use PreparedStatement in Batch mode?
PreparedStatement pStmt = ...;
while(...) { // use for or whatever loop
pStmt.clearParameters();
pStmt.setBinaryStream(2, ...);
pStmt.addBatch();
}
pStmt.executeBatch();
For more detailed information on how you can make Batches efficient with JDBC and MySQL have a look here: MySQL and JDBC with rewriteBatchedStatements=true