AXL 12.5
, Apache CXF 3.3.6
, OpenJDK 14
, Spring Boot 2.3.0
, 执行 SQL 查询
String sqlStmt = "SELECT name FROM typeuserlocale";
ExecuteSQLQueryReq executeSQLQueryReq = new ExecuteSQLQueryReq();
executeSQLQueryReq.setSql(sqlStmt);
ExecuteSQLQueryRes executeSQLQueryRes = axlPort.executeSQLQuery(executeSQLQueryReq);
List<Object> rows = executeSQLQueryRes.getReturn().getRow();
给出一个响应List<Object>
,如何解析结果?将对象转换为什么?
调试显示它是一个ElementNSImpl
. 尝试将其强制转换为ElementNSImpl
导致 IDE 添加依赖项:
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.9.1</version>
</dependency>
但是铸造它导致了一个例外:
java.lang.ClassCastException:
class com.sun.org.apache.xerces.internal.dom.ElementNSImpl cannot be cast to class org.apache.xerces.dom.ElementNSImpl (com.sun.org.apache.xerces.internal.dom.ElementNSImpl is in module java.xml of loader 'bootstrap';
org.apache.xerces.dom.ElementNSImpl is in unnamed module of loader 'app')