I am trying to stick logging data into the database of an AnyLogic model. Using QueryDSL this works out to thousands of individual inserts per second and the database doesn't seem to be able to handle it.
I haven't been able to find a method for using a prepared query. My backup resort is to just make a giant SQL string trying to batch all the inserts into a single query.
Are prepared statements even possible? Is there a better way?
Kind regards, Dave.
Prepared statements are absolutely possible. Any SQL query/statement is possible.
Instead of using the standard Java code, simply prepare your SQL statement as a string and call it with executeStatement(myStatement);
Example:
executeStatement("INSERT INTO table_eu (country, capital) VALUES ('Croatia', 'Zagreb')");
Also, for each dbase table, make sure to set it to the option below under the "Advanced" properties: