{"record":{"id":"1932f1baa235d77f","repo":"prestodb/presto","slug":"createclob","errorCode":null,"errorMessage":"createClob","messagePattern":"createClob","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoConnection.java","lineNumber":505,"sourceCode":"    @Override\n    public PreparedStatement prepareStatement(String sql, int[] columnIndexes)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"prepareStatement\");\n    }\n\n    @Override\n    public PreparedStatement prepareStatement(String sql, String[] columnNames)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"prepareStatement\");\n    }\n\n    @Override\n    public Clob createClob()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"createClob\");\n    }\n\n    @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()","sourceCodeStart":487,"sourceCodeEnd":523,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoConnection.java#L487-L523","documentation":"PrestoConnection.createClob() is a stub that unconditionally throws SQLFeatureNotSupportedException(\"createClob\"). The Presto JDBC driver does not implement client-side Clob creation, so the method fails before any request reaches the server. This is intentional: Presto models large text as VARCHAR and the driver has no Clob support.","triggerScenarios":"Calling connection.createClob() directly, or an ORM/framework that materializes Clob objects for setString/setCharacterStream-style parameter binding.","commonSituations":"Porting code written against Oracle/Postgres drivers that use Clob for large text; Hibernate/JDBC type mappings forcing Types.CLOB; generic JDBC tools probing driver capabilities.","solutions":["Replace Clob usage with String: the driver supports setString/getString for VARCHAR columns","Update ORM dialect/type mappings so CLOB-typed fields are bound as strings","Guard driver-specific Clob paths with a capability check and fall back to setString"],"exampleFix":"// before\nClob clob = connection.createClob();\nclob.setString(1, largeText);\nps.setClob(1, clob);\n// after\nps.setString(1, largeText);","handlingStrategy":"try-catch","validationCode":"DatabaseMetaData meta = connection.getMetaData();\nif (meta.getDriverName().contains(\"Presto\")) {\n    // driver does not support createClob — use string binding\n}","typeGuard":"static boolean supportsClientClob(DatabaseMetaData meta) throws SQLException {\n    return !meta.getDriverName().contains(\"Presto\");\n}","tryCatchPattern":"try {\n    Clob clob = connection.createClob();\n    // ... use clob\n} catch (SQLFeatureNotSupportedException e) {\n    // fall back: bind text with ps.setString(...)\n}","preventionTips":["Never call createClob on the Presto driver; bind large text with setString","Keep ORM type mappings for Presto as VARCHAR/String, not Types.CLOB","Centralize parameter binding so Clob paths are guarded in one place"],"tags":["jdbc","presto","unsupported-operation","clob"],"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"}