-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathOutputBuffer.java
More file actions
48 lines (34 loc) · 1.22 KB
/
OutputBuffer.java
File metadata and controls
48 lines (34 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package org.utplsql.api;
import java.io.PrintStream;
import java.sql.*;
import java.util.List;
public abstract class OutputBuffer implements SQLData {
private String outputId;
public OutputBuffer(String outputId) {
this.outputId = outputId;
}
public String getOutputId() {
return outputId;
}
private void setOutputId(String outputId) {
this.outputId = outputId;
}
public abstract void printAvailable(Connection conn, PrintStream ps) throws SQLException;
public abstract void printAvailable(Connection conn, List<PrintStream> printStreams) throws SQLException;
public abstract void fetchAvailable(Connection conn, Callback cb) throws SQLException;
public abstract List<String> fetchAll(Connection conn) throws SQLException;
@Override
public void readSQL(SQLInput stream, String typeName) throws SQLException {
setOutputId(stream.readString());
}
@Override
public void writeSQL(SQLOutput stream) throws SQLException {
stream.writeString(getOutputId());
}
/**
* Callback to be called when a new line is available from the output buffer.
*/
public interface Callback {
void onLineFetched(String s);
}
}