tursodatabase/turso · warning · SQLFeatureNotSupportedException

createSQLXML not supported

Error message

createSQLXML not supported

What it means

Connection.createSQLXML() unconditionally throws SQLFeatureNotSupportedException. The driver does not implement the SQLXML interface; there is no XML datatype at the engine level, and XML documents are simply stored as TEXT strings.

Source

Thrown at bindings/java/src/main/java/tech/turso/jdbc4/JDBC4Connection.java:284

  @Override
  public Clob createClob() throws SQLException {
    throw new SQLFeatureNotSupportedException("createClob not supported");
  }

  @Override
  public Blob createBlob() throws SQLException {
    throw new SQLFeatureNotSupportedException("createBlob not supported");
  }

  @Override
  public NClob createNClob() throws SQLException {
    throw new SQLFeatureNotSupportedException("createNClob not supported");
  }

  @Override
  @SkipNullableCheck
  public SQLXML createSQLXML() throws SQLException {
    throw new SQLFeatureNotSupportedException("createSQLXML not supported");
  }

  @Override
  public boolean isValid(int timeout) throws SQLException {
    if (isClosed()) {
      return false;
    }

    try (Statement statement = createStatement()) {
      return statement.execute("select 1;");
    }
  }

  @Override
  public void setClientInfo(String name, String value) throws SQLClientInfoException {
    // TODO
  }

View on GitHub (pinned to bad083fafb)

Solutions

  1. Serialize the XML to a String and store it in a TEXT column with setString.
  2. Parse it back with a Java XML parser after getString; the engine never interprets the content.
  3. Remove SQLXML-typed fields from entity mappings when targeting this driver.
  4. If XML querying (XPath etc.) is needed, do it in application code after fetching the text.

Example fix

// before
SQLXML xml = conn.createSQLXML(); // throws
xml.setString(docXml);
ps.setSQLXML(2, xml);

// after
ps.setString(2, docXml); // store XML as TEXT; parse in app code
Defensive patterns

Strategy: fallback

Validate before calling

// store XML as TEXT; the engine has no XML type
ps.setString(parameterIndex, xmlString);

Try / catch

try {
    SQLXML xml = conn.createSQLXML();
    xml.setString(docXml);
    ps.setSQLXML(i, xml);
} catch (SQLFeatureNotSupportedException e) {
    ps.setString(i, docXml); // fallback: serialize XML to string
}

Prevention

When it happens

Trigger: Direct conn.createSQLXML() calls; code ported from SQL Server/DB2/PostgreSQL where XML columns map to SQLXML objects; ORM mapping XML attributes via SQLXML; frameworks serializing objects to XML before storage.

Common situations: Migrating applications with SQL XML columns; Hibernate/XML-mapping utilities; code that round-trips documents via setSQLXML/getSQLXML.

Related errors


AI-assisted analysis of tursodatabase/turso@bad083fafb (2026-08-16). Data as JSON: /api/errors/20b5e16c5da57854. Report an issue: GitHub.