Mercurial > hg > monetdb-java
diff tests/SQLcopyinto.java @ 700:940e266eeccd
Refactor BufferedMCLReader
It used to inherit from BufferedReader but there is no reason for that.
Also, it used to have a method readLine() which
- returned the line read
- stored the linetype
In the new setup we have a method advance() which reads
a line and stores both it and its type.
This makes the code more regular and makes it possible to
peek ahead without consuming.
author | Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com> |
---|---|
date | Thu, 08 Dec 2022 15:59:17 +0100 (2022-12-08) |
parents | 6aa38e8c0f2d |
children | aeb268156580 |
line wrap: on
line diff
--- a/tests/SQLcopyinto.java +++ b/tests/SQLcopyinto.java @@ -7,7 +7,6 @@ */ import java.sql.*; -import java.io.*; import java.util.*; import org.monetdb.mcl.net.MapiSocket; import org.monetdb.mcl.io.BufferedMCLReader; @@ -102,7 +101,7 @@ public class SQLcopyinto { BufferedMCLReader mclIn = server.getReader(); BufferedMCLWriter mclOut = server.getWriter(); - String error = mclIn.waitForPrompt(); + String error = mclIn.discardRemainder(); if (error != null) System.err.println("Received start error: " + error); @@ -120,12 +119,12 @@ public class SQLcopyinto { } mclOut.writeLine(""); // need this one for synchronisation over flush() - error = mclIn.waitForPrompt(); + error = mclIn.discardRemainder(); if (error != null) System.err.println("Received error: " + error); mclOut.writeLine(""); // need this one for synchronisation over flush() - error = mclIn.waitForPrompt(); + error = mclIn.discardRemainder(); if (error != null) System.err.println("Received finish error: " + error);