{"record":{"id":"edb9e1a189c3b229","repo":"prestodb/presto","slug":"createsqlxml","errorCode":null,"errorMessage":"createSQLXML","messagePattern":"createSQLXML","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoConnection.java","lineNumber":526,"sourceCode":"    @Override\n    public Blob createBlob()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"createBlob\");\n    }\n\n    @Override\n    public NClob createNClob()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"createNClob\");\n    }\n\n    @Override\n    public SQLXML createSQLXML()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"createSQLXML\");\n    }\n\n    @Override\n    public boolean isValid(int timeout)\n            throws SQLException\n    {\n        if (timeout < 0) {\n            throw new SQLException(\"Timeout is negative\");\n        }\n        return !isClosed();\n    }\n\n    @Override\n    public void setClientInfo(String name, String value)\n            throws SQLClientInfoException\n    {\n        requireNonNull(name, \"name is null\");\n        if (value != null) {","sourceCodeStart":508,"sourceCodeEnd":544,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoConnection.java#L508-L544","documentation":"PrestoConnection.createSQLXML() unconditionally throws SQLFeatureNotSupportedException(\"createSQLXML\"). The driver does not implement the JDBC 4.0 SQLXML type, so the stub always fails without contacting the server. XML must be handled as application-level strings or binary data.","triggerScenarios":"Calling connection.createSQLXML(), or frameworks binding XML-typed parameters through PreparedStatement.setSQLXML.","commonSituations":"Applications storing XML documents in VARCHAR/JSON columns ported from databases with native XML types; ORMs with SQLXML type handlers enabled.","solutions":["Store XML as VARCHAR (or JSON) and bind with setString","Serialize/deserialize XML in application code (e.g. DOM/JAXB) instead of SQLXML","Catch SQLFeatureNotSupportedException and fall back to string binding"],"exampleFix":"// before\nSQLXML xml = connection.createSQLXML();\nxml.setString(doc);\nps.setSQLXML(1, xml);\n// after\nps.setString(1, doc);","handlingStrategy":"try-catch","validationCode":"DatabaseMetaData meta = connection.getMetaData();\nif (meta.getDriverName().contains(\"Presto\")) {\n    // driver does not support createSQLXML — handle XML as string\n}","typeGuard":"static boolean supportsSQLXML(DatabaseMetaData meta) throws SQLException {\n    return !meta.getDriverName().contains(\"Presto\");\n}","tryCatchPattern":"try {\n    SQLXML xml = connection.createSQLXML();\n    // ... use xml\n} catch (SQLFeatureNotSupportedException e) {\n    // fall back: ps.setString(...) with the serialized document\n}","preventionTips":["Store XML as VARCHAR/JSON and serialize in application code","Disable SQLXML type handlers in ORMs when connecting to Presto","Keep document (de)serialization out of the JDBC layer"],"tags":["jdbc","presto","unsupported-operation","sqlxml"],"backgroundTag":"sql-feature-not-supported","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}