Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not displaying XML text when using XML data types and java.sql.SQLXML #537

Open
tciampaglia opened this issue Sep 15, 2021 · 0 comments
Open

Comments

@tciampaglia
Copy link

My company's software works with 3 DBs: Oracle, SQL Server and PostgreSQL. And we've been using p6spy to capture insert/update/deletes to store for various reasons. When using the XML data type (XMLTYPE on Oracle), we cannot get the actual XML value from the p6spy output. Here's an example:

CREATE TABLE temp_xml_test ( xml_id integer CONSTRAINT xml_test_pk PRIMARY KEY, xml_col xml -- xml_col xmltype (Oracle) );

Then set the data on the SQL statement:

public void setSQLXML(int colIndex, String data) throws SQLException { SQLXML xml = getSqlXmlInstance(); xml.setString(data); _statement.setSQLXML(colIndex, xml); }

Here's the p6spy output (Oracle and Postgres examples):

`UPDATE TEMP_XML_TEST SET XML_COL='oracle.xdb.XMLType@11d6fc4' WHERE XML_ID=14

UPDATE TEMP_XML_TEST SET XML_COL='org.postgresql.jdbc.PgSQLXML@10040562' WHERE XML_ID=14`

Without the contents of the XML, this is not helpful. p6spy seems rely on the toString method of the underlying objects. These XML type objects seems to use other methods (such as SQLXML has a getString method: public abstract java.lang.String getString() throws java.sql.SQLException;).

I'd like to request that p6spy handle these XML types in the future by display the text of the XML and not just Java internal string representation that is basically just the name of the class.

Thanks,
Tom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant