I have a very big SQL query with the following structure in a Java String.
BEGIN;
couple of thousand of INSERT INTO
END;
The class that holds this String is nearly not responsive in Netbeans IDE due to the file size. What is the best way to store, load and run such big queries?
Assuming you want to run the command from within Java (not use the db’s bulk load binaries), you can store the SQL in a separate (resource) file, read the file into a string form Java, and then execute it against the database. One other benefit (besides the fact that it’s no longer in the Java file) is that you can name the resource file in such a way as to have your IDE fontify it as SQL for you (assuming your IDE does such).