-
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.04 KB
/
DefaultOutputBuffer.java
File metadata and controls
37 lines (32 loc) · 1.04 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 oracle.jdbc.OracleCallableStatement;
import oracle.jdbc.OracleConnection;
import oracle.jdbc.OracleTypes;
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 {
OracleConnection oraConn = conn.unwrap(OracleConnection.class);
OracleCallableStatement cstmt = (OracleCallableStatement) oraConn.prepareCall("{? = call ?.get_lines_cursor() }");
cstmt.registerOutParameter(1, OracleTypes.CURSOR);
cstmt.setORAData(2, getReporter());
return cstmt;
}
}