{"record":{"id":"0f275562cb7a026d","repo":"prestodb/presto","slug":"seturl","errorCode":null,"errorMessage":"setURL","messagePattern":"setURL","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"warning","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoPreparedStatement.java","lineNumber":554,"sourceCode":"    @Override\n    public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal)\n            throws SQLException\n    {\n        throw new NotImplementedException(\"PreparedStatement\", \"setTimestamp\");\n    }\n\n    @Override\n    public void setNull(int parameterIndex, int sqlType, String typeName)\n            throws SQLException\n    {\n        setNull(parameterIndex, sqlType);\n    }\n\n    @Override\n    public void setURL(int parameterIndex, URL x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"setURL\");\n    }\n\n    @Override\n    public ParameterMetaData getParameterMetaData()\n            throws SQLException\n    {\n        throw new NotImplementedException(\"PreparedStatement\", \"getParameterMetaData\");\n    }\n\n    @Override\n    public void setRowId(int parameterIndex, RowId x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"setRowId\");\n    }\n\n    @Override\n    public void setNString(int parameterIndex, String value)","sourceCodeStart":536,"sourceCodeEnd":572,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoPreparedStatement.java#L536-L572","documentation":"PrestoPreparedStatement.setURL is an unimplemented JDBC 4 method stub that unconditionally throws SQLFeatureNotSupportedException. The Presto JDBC driver does not support binding java.net.URL parameters to prepared statements. Callers must use supported setter types (e.g. setString with the URL's string form) instead.","triggerScenarios":"Calling PreparedStatement.setURL(int parameterIndex, java.net.URL x) on a PrestoPreparedStatement; any framework that auto-maps a URL-typed bean field to setObject-style JDBC binding via setURL.","commonSituations":"ORM or data-migration tools binding java.net.URL columns; hand-written JDBC code ported from drivers (e.g. PostgreSQL, MySQL) that support setURL; generic query builders that reflect over parameter types and dispatch to setURL.","solutions":["Replace the call with setString(parameterIndex, x.toString()) and let the server cast the string to the target column type","Cast the URL to String in application code before binding","Check the Presto JDBC driver documentation for the supported parameter types list and adjust the mapping layer"],"exampleFix":"// before\npstmt.setURL(1, new URL(\"https://example.com\"));\n// after\npstmt.setString(1, \"https://example.com\");","handlingStrategy":"fallback","validationCode":"if (x != null && !(x instanceof java.io.Serializable)) throw new IllegalArgumentException(\"URL must be serializable\"); // bind as string instead\npstmt.setString(parameterIndex, x == null ? null : x.toString());","typeGuard":"boolean isSupportedSetter(Object v) { return v instanceof String || v instanceof Number || v instanceof Boolean || v instanceof java.time.temporal.Temporal || v instanceof byte[]; }","tryCatchPattern":"try { pstmt.setURL(idx, url); } catch (SQLFeatureNotSupportedException e) { pstmt.setString(idx, url.toString()); }","preventionTips":["Never use setURL or other JDBC 4 N-/locator setters against Presto","Centralize parameter binding in one mapper that only uses Presto-supported setters","Check the driver's supported types table before adding a new bind type"],"tags":["jdbc","unsupported-feature","prepared-statement"],"backgroundTag":"sqlfeaturenotsupported","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"}