pgjdbc/pgjdbc GitHub issues and pull requests (mirror)  
help / color / mirror / Atom feed
[pgjdbc/pgjdbc] issue #3424: Using postgresql-42.7.4.jar triggers PSQLException
5+ messages / 2 participants
[nested] [flat]

* [pgjdbc/pgjdbc] issue #3424: Using postgresql-42.7.4.jar triggers PSQLException
@ 2024-10-25 13:33 "mEkdal (@mEkdal)" <[email protected]>
  0 siblings, 0 replies; 5+ messages in thread

From: mEkdal (@mEkdal) @ 2024-10-25 13:33 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

When using postgresql-42.7.4.jar the "org.postgresql.util.PSQLException: Unknown value for ResultSet type
Unknown value for ResultSet type" is triggered.

Java version: openjdk version "1.8.0_422"
OS Version: Microsoft Windows 11 Home. 10.0.22631 Build 22631
PostgreSQL Version:  "PostgreSQL 13.12, compiled by Visual C++ build 1914, 64-bit"

Is works in a number of earlier versions up to postgresql-42.7.3.jar

The statement looks like this:
Statement stmt = conn.createStatement(ResultSet.CONCUR_READ_ONLY,ResultSet.TYPE_FORWARD_ONLY,ResultSet.CLOSE_CURSORS_AT_COMMIT ); 

The values are the same in both 42.7.3 and 42.7.4 but fails in 42.7.4.
System.out.println(ResultSet.CONCUR_READ_ONLY+" "+ResultSet.TYPE_FORWARD_ONLY+" "+ResultSet.CLOSE_CURSORS_AT_COMMIT);
Result: 1007 1003 2


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: [pgjdbc/pgjdbc] issue #3424: Using postgresql-42.7.4.jar triggers PSQLException
@ 2024-10-25 14:02 ` "davecramer (@davecramer)" <[email protected]>
  3 siblings, 0 replies; 5+ messages in thread

From: davecramer (@davecramer) @ 2024-10-25 14:02 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

Thanks for the report

Dave Cramer


On Fri, Oct 25, 2024 at 4:34 PM Michael Ekdal ***@***.***>
wrote:

> When using postgresql-42.7.4.jar the "org.postgresql.util.PSQLException:
> Unknown value for ResultSet type
> Unknown value for ResultSet type" is triggered.
>
> Is works in a number of earlier versions up to postgresql-42.7.3.jar
>
> The statement looks like this:
> Statement stmt =
> conn.createStatement(ResultSet.CONCUR_READ_ONLY,ResultSet.TYPE_FORWARD_ONLY,ResultSet.CLOSE_CURSORS_AT_COMMIT
> );
>
> The values are the same in both 42.7.3 and 42.7.4 but fails in 42.7.4.
> System.out.println(ResultSet.CONCUR_READ_ONLY+"
> "+ResultSet.TYPE_FORWARD_ONLY+" "+ResultSet.CLOSE_CURSORS_AT_COMMIT);
> Result: 1007 1003 2
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/pgjdbc/pgjdbc/issues/3424;, or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AADDH5QEYCMP55CI3NRXJQTZ5JCFXAVCNFSM6AAAAABQTJU2LG...;
> .
> You are receiving this because you are subscribed to this thread.Message
> ID: ***@***.***>
>


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: [pgjdbc/pgjdbc] issue #3424: Using postgresql-42.7.4.jar triggers PSQLException
@ 2024-11-12 13:37 ` "mEkdal (@mEkdal)" <[email protected]>
  3 siblings, 0 replies; 5+ messages in thread

From: mEkdal (@mEkdal) @ 2024-11-12 13:37 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

package Jvakt;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;


public class test07 {

    public static void main(String[] args) throws Exception {

        try (Connection con = DriverManager.getConnection(
                "jdbc:postgresql://localhost/Jvakt", "test", "test")) {
            Statement stmt = con.createStatement(ResultSet.CONCUR_READ_ONLY,ResultSet.TYPE_FORWARD_ONLY,ResultSet.CLOSE_CURSORS_AT_COMMIT );
            
            	stmt.executeQuery("create table streamtable (bin text, str text)");
           	
            }
        }
    }


42.7.4.jar   =>
Exception in thread "main" org.postgresql.util.PSQLException: Unknown value for ResultSet type
	at org.postgresql.jdbc.PgStatement.<init>(PgStatement.java:166)
	at org.postgresql.jdbc.PgConnection.createStatement(PgConnection.java:1404)
	at Jvakt.test07.main(test07.java:16)

42.7.3.jar  =>
The table streamtable is created. I ignored the exeption below. 
Exception in thread "main" org.postgresql.util.PSQLException: No results were returned by the query.
	at org.postgresql.jdbc.PgStatement.executeQuery(PgStatement.java:252)
	at Jvakt.test07.main(test07.java:18)




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: [pgjdbc/pgjdbc] issue #3424: Using postgresql-42.7.4.jar triggers PSQLException
@ 2025-05-29 10:26 ` "mEkdal (@mEkdal)" <[email protected]>
  3 siblings, 0 replies; 5+ messages in thread

From: mEkdal (@mEkdal) @ 2025-05-29 10:26 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

Testing 42.7.6.jar and the same error persists :) .

**This statement:**
_Statement stmt = conn.createStatement(ResultSet.CONCUR_READ_ONLY,ResultSet.TYPE_FORWARD_ONLY,ResultSet.CLOSE_CURSORS_AT_COMMIT );_

**Trigger this error:**
_org.postgresql.util.PSQLException: Unknown value for ResultSet type
Unknown value for ResultSet type_

Thus not all types of resultset codes according to the manual is allowed since the problem appeared in 42.7.4.

BR
/Michael 

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: [pgjdbc/pgjdbc] issue #3424: Using postgresql-42.7.4.jar triggers PSQLException
@ 2025-06-09 08:42 ` "mEkdal (@mEkdal)" <[email protected]>
  3 siblings, 0 replies; 5+ messages in thread

From: mEkdal (@mEkdal) @ 2025-06-09 08:42 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

Changed the order of the parameters of the createStatement to conn.createStatement(ResultSet.TYPE_FORWARD_ONLY,ResultSet.CONCUR_READ_ONLY,ResultSet.HOLD_CURSORS_OVER_COMMIT );
and now it works. 

^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2025-06-09 08:42 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-10-25 13:33 [pgjdbc/pgjdbc] issue #3424: Using postgresql-42.7.4.jar triggers PSQLException "mEkdal (@mEkdal)" <[email protected]>
2024-10-25 14:02 ` "davecramer (@davecramer)" <[email protected]>
2024-11-12 13:37 ` "mEkdal (@mEkdal)" <[email protected]>
2025-05-29 10:26 ` "mEkdal (@mEkdal)" <[email protected]>
2025-06-09 08:42 ` "mEkdal (@mEkdal)" <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox