pgjdbc/pgjdbc GitHub issues and pull requests (mirror)  
help / color / mirror / Atom feed
From: davecramer (@davecramer) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: Re: [pgjdbc/pgjdbc] issue #3426: 42.7.4 introduced error when binding java.io.FileInputStream
Date: Tue, 29 Oct 2024 11:26:05 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

I cannot replicate this with
```
import java.io.FileInputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;

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

        try (Connection con = DriverManager.getConnection(
                "jdbc:postgresql://localhost/test", "test", "")) {
            con.createStatement().execute("create temporary table streamtable (bin bytea, str text)");
            FileInputStream fis = new FileInputStream("./pom.xml");
            try (PreparedStatement pstmt =
                         con.prepareStatement("INSERT INTO streamtable (bin,str) VALUES (?,?)")) {

                pstmt.setBinaryStream(1, fis);
                pstmt.setString(2, null);
                pstmt.executeUpdate();

            }
        }
    }
}
```

Do we have any idea what else is going on ?

view thread (14+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: github://pgjdbc/pgjdbc
  Cc: [email protected], [email protected]
  Subject: Re: [pgjdbc/pgjdbc] issue #3426: 42.7.4 introduced error when binding java.io.FileInputStream
  In-Reply-To: <<[email protected]>>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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