I'm not sure I follow you. Here's an MCLIENT session to demonstrate what I observe:
sql>COPY INTO alert_tbl FROM STDIN USING DELIMITERS ',','\\n','\"';
COPY INTO: no such table 'alert_tbl'
sql>rollback;
auto commit mode: off
sql>COPY INTO clk.alert_tbl FROM STDIN USING DELIMITERS ',','\\n','\"';
more>
Note how when I issue a bad COPY INTO command, I immediately get a prompt telling me it was no good.
Note how when I issue a good COPY INTO command, I immediately get a prompt asking for more.
That 2nd prompt manifests in my code as a null response to waitForPrompt(), and it does so consistently.
I just tested my proposed change to the example and it works consistently. Have you tested the example with and without a bad COPY INTO?
Cheers,
Percy
P.S. To be safe, I've now switched to using COPY INTO ... FROM file and just write my files to /dev/shm