{"record":{"id":"0c06ad1539dda49c","repo":"prestodb/presto","slug":"geturl","errorCode":null,"errorMessage":"getURL","messagePattern":"getURL","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java","lineNumber":1215,"sourceCode":"    @Override\n    public Timestamp getTimestamp(int columnIndex, Calendar cal)\n            throws SQLException\n    {\n        return getTimestamp(columnIndex, DateTimeZone.forTimeZone(cal.getTimeZone()));\n    }\n\n    @Override\n    public Timestamp getTimestamp(String columnLabel, Calendar cal)\n            throws SQLException\n    {\n        return getTimestamp(columnIndex(columnLabel), cal);\n    }\n\n    @Override\n    public URL getURL(int columnIndex)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"getURL\");\n    }\n\n    @Override\n    public URL getURL(String columnLabel)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"getURL\");\n    }\n\n    @Override\n    public void updateRef(int columnIndex, Ref x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateRef\");\n    }\n\n    @Override\n    public void updateRef(String columnLabel, Ref x)","sourceCodeStart":1197,"sourceCodeEnd":1233,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java#L1197-L1233","documentation":"getURL(int) is not implemented: Presto's driver never materializes java.net.URL values, so it always throws SQLFeatureNotSupportedException(\"getURL\"). Read the column as a String and construct a URL yourself.","triggerScenarios":"Calling rs.getURL(columnIndex) on any PrestoResultSet.","commonSituations":"Code that assumed DATALINK column support; ported getter code from drivers like Derby that support getURL.","solutions":["Use rs.getString(columnIndex) and new URL(value) (or URI.create) yourself","Guard for null/blank strings before parsing","Drop DATALINK assumptions — Presto has no DATALINK type"],"exampleFix":"// before\nURL url = rs.getURL(1);\n// after\nString s = rs.getString(1);\nURL url = (s == null) ? null : new URL(s);","handlingStrategy":"try-catch","validationCode":"int type = rs.getMetaData().getColumnType(columnIndex);\nif (type == Types.DATALINK) { /* Presto never returns DATALINK */ }","typeGuard":null,"tryCatchPattern":"try {\n    return rs.getURL(columnIndex);\n} catch (SQLFeatureNotSupportedException e) {\n    String s = rs.getString(columnIndex);\n    return s == null ? null : new java.net.URL(s);\n}","preventionTips":["Read URLs as VARCHAR strings and parse manually","Do not rely on DATALINK support","Null/blank-check before URL parsing"],"tags":["jdbc","unsupported-feature","sqlfeaturenotsupported"],"backgroundTag":"unsupported-jdbc-feature","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"}