How can I execute multiple select queries with a single executeQuery()?

Joe Sam Shirah

Different DBMS engines use different statement terminators. The usual advice is to use none at all and let the driver handle it. Unless the driver is smart enough to figure out where each statement begins and ends, in this case you really can't do that. Unfortunately, there doesn't seem to be a method in the driver or metadata classes to get the DBMS specific terminator used. So, this area doesn't appear to be very portable. If you are certain that there actually is nothing invalid in your statements, the other possibility is that your driver just won't handle this properly, so the last step is to check with your DBMS's technical support.