N
N
Nikolay Baranenko2017-05-19 15:25:04
Java
Nikolay Baranenko, 2017-05-19 15:25:04

How to correctly display information from Oracle from a field with clob type?

Hello.

There is a datasource from oracle

<c:set var="SCRIPT">
    select region_solution from region t1
</c:set>
<sql:query var="rs_list" dataSource="jdbc/region">
    ${SCRIPT}
</sql:query>

<c:forEach var="row" items="${rs_list.rows}">
            <c:set var="SOLUTION" value="${row.title}"/>
            <%
                String str_title=null;
                try {
                    Map map = (Map) pageContext.getAttribute("SOLUTION", PageContext.PAGE_SCOPE);
                    CLOB clob = ((CLOB) map.get("someClob"));        
                    str_title=  clob.getSubString(1, (int) clob.length());
                } catch (Exception ex) {
                    //print out exception
                }
<TD><%out.println(str_title);%></TD>
</c:forEach>


will return null, I suspect that I am passing an object and losing it here


How to solve this problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikolay Baranenko, 2017-05-19
@drno-reg

found a solution to the problem, it's all about row and SOLUTION, in general, it took longer to harness the issue

Map map = (Map) pageContext.getAttribute("row", PageContext.PAGE_SCOPE);
                    CLOB clob = ((CLOB) map.get("SOLUTION"));        
                    str_title=  clob.getSubString(1, (int) clob.length());

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question