Re: Blob's that worked in 7.1 fail in 7.2.1 - Mailing list pgsql-jdbc

From Barry Lind
Subject Re: Blob's that worked in 7.1 fail in 7.2.1
Date
Msg-id 3D7CD514.4060704@xythos.com
Whole thread Raw
In response to Blob's that worked in 7.1 fail in 7.2.1  (Michael Andreasen <michael@dunlops.com>)
List pgsql-jdbc
Michael,

Have you read the documentation on the postgres jdbc driver included in
the 7.2 docs?  It explains the changed behavior and how to revert to the
old behavior if you need to.

thanks,
--Barry

Michael Andreasen wrote:
> I have just upgrading my database to 7.2.1 (I was on 7.1.3)
>
> There are some little funnies between the two versions, mostly things
> that have been tightened up in 7.2.1.
>
> However, I have found the this code that used to work now fails. It is
> code for writting a blob (image) back into the database.
>
>                    File file = new File(imageFileName);
>                    FileInputStream fis = new FileInputStream(file);
>                    int length = (int)file.length();
>                    pStmt.setBinaryStream(1, fis, length);
>                    pStmt.setInt(2, currentEmployee);
>                    int upd = pStmt.executeUpdate();
>
> It now fails with this....
>
> java.sql.SQLException: ERROR:  oidin: error in
> "~DGR:LOGO,09180,054,000000000000000.........
>
> can't parse "~DGR:LOGO,09180,054,000000000000000........ etc, etc ....
>     at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:94)
>     at org.postgresql.Connection.ExecSQL(Connection.java:398)
>     at org.postgresql.jdbc2.Statement.execute(Statement.java:130)
>     at org.postgresql.jdbc2.Statement.executeUpdate(Statement.java:73)
>     at
> org.postgresql.jdbc2.PreparedStatement.executeUpdate(PreparedStatement.java:113)
>
>     at
> com.dunlops.warehouse.checking.SetCustomerLogo.saveLogo(SetCustomerLogo.java:124)
>
>
>
>
> What's wrong?
>
>
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>


pgsql-jdbc by date:

Previous
From: Barry Lind
Date:
Subject: Re: compile of jdbc driver failed - jdk 1.4.0_01
Next
From: Felipe Schnack
Date:
Subject: Re: postgresql-java