Search in sources :

Example 1 with CursorHandler

use of org.dbflute.jdbc.CursorHandler in project dbflute-core by dbflute.

the class OutsideSqlSelectCursorCommand method createOutsideSqlSelectResultSetHandler.

// ===================================================================================
// SqlExecution Handling
// =====================
@Override
protected TnResultSetHandler createOutsideSqlSelectResultSetHandler() {
    return new TnResultSetHandler() {

        public Object handle(ResultSet rs) throws SQLException {
            if (!OutsideSqlContext.isExistOutsideSqlContextOnThread()) {
                String msg = "The context of outside SQL should be required here!";
                throw new IllegalStateException(msg);
            }
            OutsideSqlContext context = OutsideSqlContext.getOutsideSqlContextOnThread();
            CursorHandler cursorHandler = context.getCursorHandler();
            return cursorHandler.handle(rs);
        }
    };
}
Also used : CursorHandler(org.dbflute.jdbc.CursorHandler) OutsideSqlContext(org.dbflute.outsidesql.OutsideSqlContext) TnResultSetHandler(org.dbflute.s2dao.jdbc.TnResultSetHandler) ResultSet(java.sql.ResultSet)

Aggregations

ResultSet (java.sql.ResultSet)1 CursorHandler (org.dbflute.jdbc.CursorHandler)1 OutsideSqlContext (org.dbflute.outsidesql.OutsideSqlContext)1 TnResultSetHandler (org.dbflute.s2dao.jdbc.TnResultSetHandler)1