{"record":{"id":"26a1805737befffe","repo":"quarkusio/quarkus","slug":"it-is-not-possible-to-enable-the-usefmtonly-option","errorCode":null,"errorMessage":"It is not possible to enable the useFmtOnly option on Quarkus: this option is only useful on SQL Server version 2008 (which is not supported) and introduces several other problems.","messagePattern":"It is not possible to enable the useFmtOnly option on Quarkus: this option is only useful on SQL Server version 2008 \\(which is not supported\\) and introduces several other problems\\.","errorType":"validation","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/jdbc/jdbc-mssql/runtime/src/main/java/io/quarkus/jdbc/mssql/runtime/graal/com/microsoft/sqlserver/jdbc/SQLServerJDBCSubstitutions.java","lineNumber":96,"sourceCode":"    }\n\n}\n\n/**\n * This substitution is not strictly necessary, but it helps by providing a better error message to our users.\n */\n@TargetClass(className = \"com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement\")\nfinal class DisableFMTRemove {\n\n    @Substitute\n    public final boolean getUseFmtOnly() throws SQLServerException {\n        return false;//Important for this to be disabled via a constant\n    }\n\n    @Substitute\n    public final void setUseFmtOnly(boolean useFmtOnly) throws SQLServerException {\n        if (useFmtOnly) {\n            throw new IllegalStateException(\n                    \"It is not possible to enable the useFmtOnly option on Quarkus: this option is only useful on SQL Server version 2008 (which is not supported) and introduces several other problems.\");\n        }\n    }\n\n}\n\nclass SQLServerJDBCSubstitutions {\n\n}\n","sourceCodeStart":78,"sourceCodeEnd":106,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/jdbc/jdbc-mssql/runtime/src/main/java/io/quarkus/jdbc/mssql/runtime/graal/com/microsoft/sqlserver/jdbc/SQLServerJDBCSubstitutions.java#L78-L106","documentation":"Quarkus substitutes the driver's setUseFmtOnly so that enabling useFmtOnly throws IllegalStateException in native mode. The FMT-only parameter metadata path is only useful for SQL Server 2008 (unsupported) and causes parsing problems, so Quarkus removes it and rejects attempts to enable it.","triggerScenarios":"Native-mode connection with useFmtOnly=true in the JDBC URL or Properties, or calling SQLServerDataSource/Connection.setUseFmtOnly(true), which hits the substituted setter.","commonSituations":"Workarounds copied from old MSSQL driver tuning guides; configs tuned for SQL Server 2008 in the past; code that unconditionally enables useFmtOnly for parameter metadata issues.","solutions":["Remove useFmtOnly=true from the JDBC URL/Properties (default false works fine on SQL Server 2012+)","Fix parameter metadata issues by using fully qualified or explicitly typed parameters instead of FMT-only mode","Ensure the target SQL Server is 2012+ so the default sp_describe_undeclared_parameters path is used","Deploy in JVM mode if the legacy behavior is truly required"],"exampleFix":"// before\nString url = \"jdbc:sqlserver://host;database=db;useFmtOnly=true\";\n// after\nString url = \"jdbc:sqlserver://host;database=db\";","handlingStrategy":"validation","validationCode":"if (url.contains(\"useFmtOnly=true\")) { throw new IllegalArgumentException(\"useFmtOnly=true is not supported in native mode\"); }","typeGuard":"static boolean enablesUseFmtOnly(String url) { return url != null && url.toLowerCase().contains(\"usefmtonly=true\"); }","tryCatchPattern":"try { conn = ds.getConnection(); } catch (IllegalStateException e) { if (e.getMessage().contains(\"useFmtOnly\")) { log.error(\"Remove useFmtOnly=true from the connection string\"); } throw e; }","preventionTips":["Never set useFmtOnly=true in modern deployments","Grep connection strings/Properties for useFmtOnly during native migration reviews","Fix parameter metadata issues with typed parameters instead","Keep legacy FMT-only tuning only in JVM-mode configs"],"tags":["native-image","jdbc","mssql","usefmtonly","compatibility"],"backgroundTag":"native-image-unsupported-feature","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}