Message-ID: From: "DmitriyGod (@DmitriyGod)" To: "pgjdbc/pgjdbc" Date: Mon, 10 Mar 2025 15:43:19 +0000 Subject: [pgjdbc/pgjdbc] issue #3563: CallableStatement.getObject(parameterIndex, toClass) does not works List-Id: X-GitHub-Author-Id: 44647125 X-GitHub-Author-Login: DmitriyGod X-GitHub-Issue: 3563 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-State: open X-GitHub-Type: issue X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/issues/3563 Content-Type: text/plain; charset=utf-8 **Describe the issue** CallableStatement.getObject(parameterIndex, toClass) does not works. **Driver Version?** latest **Java Version?** any **OS Version?** any **PostgreSQL Version?** latest **To Reproduce** ```SQL create procedure p_date(in a date, out b date) language plpgsql AS $$ begin b = a; end; $$; ``` ```Java var call = cn.prepareCall("call p_date(?, ?)"); call.setObject(1, LocalDate.of(1970, 1, 1)); call.registerOutParameter(2, Types.DATE); call.execute(); var v = call.getObject(2, LocalDate.class); ``` **Expected behaviour** No exception. Instance of LocalDate returned. **Logs** ``` Unsupported type conversion to {1}. org.postgresql.util.PSQLException: Unsupported type conversion to {1}. at org.postgresql.jdbc.PgCallableStatement.getObject(PgCallableStatement.java:735) ``` it looks like it's not implemented ```Java public @Nullable T getObject(int parameterIndex, Class type) throws SQLException { if (type == ResultSet.class) { return type.cast(this.getObject(parameterIndex)); } else { throw new PSQLException(GT.tr("Unsupported type conversion to {1}.", new Object[]{type}), PSQLState.INVALID_PARAMETER_VALUE); } } ```