3
Hello, Good morning in my company we are testing the Oracle 12c. And I found a "little problem" to query a field that is the type Xmltype. We store all the nfe xml in the database, so we always have to query this xml. The problem is this, when I do the query in Oracle 12, the xml comes formatted, and so loses the digital signature of the file. Does anyone have any hint on how to bring this unformatted xml?!? any help is very welcome. Follows my code:
PreparedStatement st = con.prepareStatement("select nfe_xml from nfe_xml where NFE_CHAVE_ACESSO = ?");
st.setString(1, chaveAcesso);
ResultSet rs = st.executeQuery();
OracleResultSet orset = (OracleResultSet) rs;
while(orset.next())
{
//orset.getOPAQUE(1);
//XMLType poxml = XMLType.createXML(orset.getOPAQUE("NFE_XML"));
XMLType poxml = (XMLType)orset.getObject(1);
String sXml = ( poxml).getStringVal();
System.out.println("xml: "+sXml);
podoc = (Document)poxml.getDOM();
Util.gravarXmlNfe("C:\\NFE\\"+chaveAcesso+".xml", podoc);
String sXml2 =Util.convert(podoc, null) ;
System.out.println(sXml2);
}
Are you wearing any Feature specific XML manipulation in the database? If not a possible path is to replace its type with a
CLOB
.– Anthony Accioly