tursodatabase/turso · error · SQLFeatureNotSupportedException

createSQLXML not supported

Error message

createSQLXML not supported

What it means

Connection.createSQLXML() throws SQLFeatureNotSupportedException at JDBC4Connection.java:284. SQLXML objects hold XML-typed column values in databases with a native XML type; SQLite has no XML column type, so the driver provides no way to create these values. Store XML as TEXT strings and parse in the application.

Solutions

  1. Store XML as TEXT and bind with setString; parse with your XML library after reading.
  2. Change java.sql.SQLXML entity attributes to String.
  3. Disable any ORM XML-column mapping strategy that binds via SQLXML.
  4. Catch SQLFeatureNotSupportedException in capability-probing code and record XML as unsupported.

Example fix

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

// after
ps.setString(1, docXml); // column type TEXT
Defensive patterns

Strategy: try-catch

Validate before calling

// store XML as TEXT; parse in the application
// ps.setString(index, xmlString) is the supported path

Try / catch

try {
    SQLXML xml = conn.createSQLXML();
} catch (SQLFeatureNotSupportedException e) {
    // XML type unsupported: bind as TEXT with setString
}

Prevention

When it happens

Trigger: conn.createSQLXML() followed by sqlxml.setString(...) and setSQLXML(...); Hibernate/JPA with java.sql.SQLXML-typed attributes or hibernate @JdbcTypeCode(SqlTypes.XML); frameworks serializing objects to XML columns; database tools that probe XML support.

Common situations: Migrations from SQL Server (xml column type) or PostgreSQL (xml type) where JDBC uses SQLXML; JPA entities mapping XML documents; generic persistence layers that support 'any' JDBC type; conformance/introspection suites scanning connection capabilities.

Related errors


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

Appendix: 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 244cde92a7)