java.sql.SQLException: Inconsistent java and sql object types: SYS.XMLTYPE

1.8k views Asked by At

Trying to read data from XMLTYPE column using spring jdbc

Declaration @Autowired OracleXmlHandler sqlXmlHandler;

Object Read as string sqlXmlHandler.getXmlAsString(resultSet, "xml_column")

getting the following exception : Caused by: java.sql.SQLException: Inconsistent java and sql object types: SYS.XMLTYPE at oracle.sql.OPAQUE.toClass(OPAQUE.java:395) ~[ojdbc6-11.2.0.4.jar:11.2.0.4.0] at oracle.sql.OPAQUE.toJdbc(OPAQUE.java:333) ~[ojdbc6-11.2.0.4.jar:11.2.0.4.0] at oracle.jdbc.driver.NamedTypeAccessor.getObject(NamedTypeAccessor.java:193) ~[ojdbc6-11.2.0.4.jar:11.2.0.4.0] at oracle.jdbc.driver.NamedTypeAccessor.getObject(NamedTypeAccessor.java:123) ~[ojdbc6-11.2.0.4.jar:11.2.0.4.0] at oracle.jdbc.driver.OracleResultSetImpl.getObject(OracleResultSetImpl.java:1108) ~[ojdbc6-11.2.0.4.jar:11.2.0.4.0] at oracle.jdbc.driver.OracleResultSet.getObject(OracleResultSet.java:462) ~[ojdbc6-11.2.0.4.jar:11.2.0.4.0] at org.jboss.jca.adapters.jdbc.WrappedResultSet.getObject(WrappedResultSet.java:1199) ~[?:?]

pom.xml has the required entries for xdb6,xmlparserv2,spring-data-oracle,spring-oxm

Tried other alternatives with out spring-jdbc as well.

Any insights will be really helpful.

0

There are 0 answers