-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDefaultOutputBuffer.java
More file actions
37 lines (32 loc) · 1.02 KB
/
Copy pathDefaultOutputBuffer.java
File metadata and controls
37 lines (32 loc) · 1.02 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
package org.utplsql.api.outputBuffer;
import org.utplsql.api.reporter.Reporter;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.SQLException;
/**
* Fetches the lines produced by a reporter.
*
* @author vinicius
* @author pesse
*/
class DefaultOutputBuffer extends AbstractOutputBuffer {
/**
* Creates a new DefaultOutputBuffer.
*
* @param reporter the reporter to be used
*/
DefaultOutputBuffer(Reporter reporter) {
super(reporter);
}
@Override
protected CallableStatement getLinesCursorStatement(Connection conn) throws SQLException {
Reporter reporter = getReporter();
String plsql = "declare" +
" l_rep " + reporter.getTypeName() + " := " + reporter.getTypeName() + "(); " +
"begin" +
" l_rep.set_reporter_id(:reporter_id); " +
" :lines_cursor := l_rep.get_lines_cursor(); " +
"end;";
return prepareLinesCursorStatement(conn, plsql);
}
}