Skip site navigation (1) Skip section navigation (2)

BLOB support is broken in the 7.2/7.3 JDBC driver, works in 7.1 driver java.sql.SQLException: ERROR: oidin: error in "\377\330\377\340...I'm on Linux 2.4.16 using JDK 1.4.0 but it fails in 1.3.1 as well. Here's a quick reproducible test case:-- start --package sample.java.jdbc;import java.sql.*;import java.io.*;import java.util.*;class testBlob{ public static void main(String args[]) { new testBlob(); System.exit(0); } public testBlob() { System.out.println("Let's begin the test ..."); String v_username = "postgre"; String v_password = "postgre"; String v_database = "jdbc:postgresql://127.0.0.1/TEST"; PreparedStatement v_pstmt = null; try { DriverManager.registerDriver(new org.postgresql.Driver()); Connection v_conn = DriverManager.getConnection( v_database, v_username, v_password); v_conn.setAutoCommit(false); File v_file = new File("/home/postgre/something.jpg"); FileInputStream v_fis = new FileInputStream(v_file); v_pstmt = v_conn.prepareStatement( "insert into lob_test (id,data) values (?,?)"); v_pstmt.setInt(1,2); v_pstmt.setBinaryStream(2,v_fis,(int)v_file.length()); System.out.println("now you see me"); v_pstmt.executeUpdate(); System.out.println("now you don't"); v_conn.commit(); v_fis.close(); v_pstmt.close(); } catch (IOException e_io) { System.out.println(e_io); } catch (SQLException e_sql) { System.out.println(e_sql); } System.out.println("You'll only get here with the 7.1 driver!"); }}-- end --01010101010101010101010101010101010101010101010101Marc P. Lavergne [wk:407-648-6996]Product DevelopmentrichLAVA Corporation--"Anyone who slaps a 'this page is best viewed withBrowser X' label on a Web page appears to beyearning for the bad old days, before the Web,when you had very little chance of reading adocument written on another computer, another wordprocessor, or another network."-Tim Berners-Lee (Technology Review, July 1996)01010101010101010101010101010101010101010101010101-- 01010101010101010101010101010101010101010101010101Marc P. Lavergne [wk:407-648-6996]Product DevelopmentrichLAVA Corporation--"Anyone who slaps a 'this page is best viewed withBrowser X' label on a Web page appears to beyearning for the bad old days, before the Web,when you had very little chance of reading adocument written on another computer, another wordprocessor, or another network."-Tim Berners-Lee (Technology Review, July 1996) java.sql.SQLException: ERROR: oidin: error in "\377\330\377\340...I'm on Linux 2.4.16 using JDK 1.4.0 but it fails in 1.3.1 as well. Here's a quick reproducible test case:-- start --package sample.java.jdbc;import java.sql.*;import java.io.*;import java.util.*;class testBlob{ public static void main(String args[]) { new testBlob(); System.exit(0); } public testBlob() { System.out.println("Let's begin the test ..."); String v_username = "postgre"; String v_password = "postgre"; String v_database = "jdbc:postgresql://127.0.0.1/TEST"; PreparedStatement v_pstmt = null; try { DriverManager.registerDriver(new org.postgresql.Driver()); Connection v_conn = DriverManager.getConnection( v_database, v_username, v_password); v_conn.setAutoCommit(false); File v_file = new File("/home/postgre/something.jpg"); FileInputStream v_fis = new FileInputStream(v_file); v_pstmt = v_conn.prepareStatement( "insert into lob_test (id,data) values (?,?)"); v_pstmt.setInt(1,2); v_pstmt.setBinaryStream(2,v_fis,(int)v_file.length()); System.out.println("now you see me"); v_pstmt.executeUpdate(); System.out.println("now you don't"); v_conn.commit(); v_fis.close(); v_pstmt.close(); } catch (IOException e_io) { System.out.println(e_io); } catch (SQLException e_sql) { System.out.println(e_sql); } System.out.println("You'll only get here with the 7.1 driver!"); }}-- end --01010101010101010101010101010101010101010101010101Marc P. Lavergne [wk:407-648-6996]Product DevelopmentrichLAVA Corporation--"Anyone who slaps a 'this page is best viewed withBrowser X' label on a Web page appears to beyearning for the bad old days, before the Web,when you had very little chance of reading adocument written on another computer, another wordprocessor, or another network."-Tim Berners-Lee (Technology Review, July 1996)01010101010101010101010101010101010101010101010101-- 01010101010101010101010101010101010101010101010101Marc P. Lavergne [wk:407-648-6996]Product DevelopmentrichLAVA Corporation--"Anyone who slaps a 'this page is best viewed withBrowser X' label on a Web page appears to beyearning for the bad old days, before the Web,when you had very little chance of reading adocument written on another computer, another wordprocessor, or another network."-Tim Berners-Lee (Technology Review, July 1996)

From: Marc Lavergne <mlavergn(at)richlava(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org, pgsql-bugs(at)postgresql(dot)org
Subject: BLOB support is broken in the 7.2/7.3 JDBC driver, works in 7.1 driver java.sql.SQLException: ERROR: oidin: error in "\377\330\377\340...I'm on Linux 2.4.16 using JDK 1.4.0 but it fails in 1.3.1 as well. Here's a quick reproducible test case:-- start --package sample.java.jdbc;import java.sql.*;import java.io.*;import java.util.*;class testBlob{ public static void main(String args[]) { new testBlob(); System.exit(0); } public testBlob() { System.out.println("Let's begin the test ..."); String v_username = "postgre"; String v_password = "postgre"; String v_database = "jdbc:postgresql://127.0.0.1/TEST"; PreparedStatement v_pstmt = null; try { DriverManager.registerDriver(new org.postgresql.Driver()); Connection v_conn = DriverManager.getConnection( v_database, v_username, v_password); v_conn.setAutoCommit(false); File v_file = new File("/home/postgre/something.jpg"); FileInputStream v_fis = new FileInputStream(v_file); v_pstmt = v_conn.prepareStatement( "insert into lob_test (id,data) values (?,?)"); v_pstmt.setInt(1,2); v_pstmt.setBinaryStream(2,v_fis,(int)v_file.length()); System.out.println("now you see me"); v_pstmt.executeUpdate(); System.out.println("now you don't"); v_conn.commit(); v_fis.close(); v_pstmt.close(); } catch (IOException e_io) { System.out.println(e_io); } catch (SQLException e_sql) { System.out.println(e_sql); } System.out.println("You'll only get here with the 7.1 driver!"); }}-- end --01010101010101010101010101010101010101010101010101Marc P. Lavergne [wk:407-648-6996]Product DevelopmentrichLAVA Corporation--"Anyone who slaps a 'this page is best viewed withBrowser X' label on a Web page appears to beyearning for the bad old days, before the Web,when you had very little chance of reading adocument written on another computer, another wordprocessor, or another network."-Tim Berners-Lee (Technology Review, July 1996)01010101010101010101010101010101010101010101010101-- 01010101010101010101010101010101010101010101010101Marc P. Lavergne [wk:407-648-6996]Product DevelopmentrichLAVA Corporation--"Anyone who slaps a 'this page is best viewed withBrowser X' label on a Web page appears to beyearning for the bad old days, before the Web,when you had very little chance of reading adocument written on another computer, another wordprocessor, or another network."-Tim Berners-Lee (Technology Review, July 1996) java.sql.SQLException: ERROR: oidin: error in "\377\330\377\340...I'm on Linux 2.4.16 using JDK 1.4.0 but it fails in 1.3.1 as well. Here's a quick reproducible test case:-- start --package sample.java.jdbc;import java.sql.*;import java.io.*;import java.util.*;class testBlob{ public static void main(String args[]) { new testBlob(); System.exit(0); } public testBlob() { System.out.println("Let's begin the test ..."); String v_username = "postgre"; String v_password = "postgre"; String v_database = "jdbc:postgresql://127.0.0.1/TEST"; PreparedStatement v_pstmt = null; try { DriverManager.registerDriver(new org.postgresql.Driver()); Connection v_conn = DriverManager.getConnection( v_database, v_username, v_password); v_conn.setAutoCommit(false); File v_file = new File("/home/postgre/something.jpg"); FileInputStream v_fis = new FileInputStream(v_file); v_pstmt = v_conn.prepareStatement( "insert into lob_test (id,data) values (?,?)"); v_pstmt.setInt(1,2); v_pstmt.setBinaryStream(2,v_fis,(int)v_file.length()); System.out.println("now you see me"); v_pstmt.executeUpdate(); System.out.println("now you don't"); v_conn.commit(); v_fis.close(); v_pstmt.close(); } catch (IOException e_io) { System.out.println(e_io); } catch (SQLException e_sql) { System.out.println(e_sql); } System.out.println("You'll only get here with the 7.1 driver!"); }}-- end --01010101010101010101010101010101010101010101010101Marc P. Lavergne [wk:407-648-6996]Product DevelopmentrichLAVA Corporation--"Anyone who slaps a 'this page is best viewed withBrowser X' label on a Web page appears to beyearning for the bad old days, before the Web,when you had very little chance of reading adocument written on another computer, another wordprocessor, or another network."-Tim Berners-Lee (Technology Review, July 1996)01010101010101010101010101010101010101010101010101-- 01010101010101010101010101010101010101010101010101Marc P. Lavergne [wk:407-648-6996]Product DevelopmentrichLAVA Corporation--"Anyone who slaps a 'this page is best viewed withBrowser X' label on a Web page appears to beyearning for the bad old days, before the Web,when you had very little chance of reading adocument written on another computer, another wordprocessor, or another network."-Tim Berners-Lee (Technology Review, July 1996)
Date: 2002-02-13 06:47:41
Message-ID: 3C6A0C0D.8050505@richlava.com (view raw or flat)
Thread:
Lists: pgsql-bugs
BLOB support is broken in the 7.2/7.3 JDBC driver, works in 7.1 driver 
though. Basically, returns an error like the following on executeUpdate():
	
java.sql.SQLException: ERROR:  oidin: error in "\377\330\377\340...

I'm on Linux 2.4.16 using JDK 1.4.0 but it fails in 1.3.1 as well. 
Here's a quick reproducible test case:

-- start --

package sample.java.jdbc;

import java.sql.*;

import java.io.*;
import java.util.*;

class testBlob
{
   public static void main(String args[])
   {
     new testBlob();
     System.exit(0);
   }

   public testBlob()
   {
     System.out.println("Let's begin the test ...");

     String v_username = "postgre";
     String v_password = "postgre";
     String v_database = "jdbc:postgresql://127.0.0.1/TEST";

     PreparedStatement v_pstmt = null;

     try
     {
       DriverManager.registerDriver(new org.postgresql.Driver());
       Connection v_conn = DriverManager.getConnection(
         v_database, v_username, v_password);

       v_conn.setAutoCommit(false);

       File v_file = new File("/home/postgre/something.jpg");
       FileInputStream v_fis = new FileInputStream(v_file);
       v_pstmt = v_conn.prepareStatement(
         "insert into lob_test (id,data) values (?,?)");

       v_pstmt.setInt(1,2);
       v_pstmt.setBinaryStream(2,v_fis,(int)v_file.length());

       System.out.println("now you see me");
       v_pstmt.executeUpdate();
       System.out.println("now you don't");

       v_conn.commit();

       v_fis.close();
       v_pstmt.close();
     }
     catch (IOException e_io)
     {
       System.out.println(e_io);
     }
     catch (SQLException e_sql)
     {
       System.out.println(e_sql);
     }
     System.out.println("You'll only get here with the 7.1 driver!");
   }
}

-- end --

01010101010101010101010101010101010101010101010101

Marc P. Lavergne [wk:407-648-6996]
Product Development
richLAVA Corporation

--

"Anyone who slaps a 'this page is best viewed with
Browser X' label on a Web page appears to be
yearning for the bad old days, before the Web,
when you had very little chance of reading a
document written on another computer, another word
processor, or another network."
-Tim Berners-Lee (Technology Review, July 1996)

01010101010101010101010101010101010101010101010101


pgsql-bugs by date

Next:From: Marc LavergneDate: 2002-02-13 07:08:46
Subject: [Fwd: BLOB support is broken in the 7.2/7.3 JDBC driver, works in 7.1 driver java.sql.SQLException: ERROR: oidin: error in "\377\330\377\340... I'm on Linux 2.4.16 using JDK 1.4.0 but it fails in 1.3.1 as well. Here's a quick reproducible test case: -- start -- package sample.java.jdbc; import java.sql.*; import java.io.*; import java.util.*; class testBlob { public static void main(String args[]) { new testBlob(); System.exit(0); } public testBlob() { System.out.println("Let's begin the test ..."); String v_username = "postgre"; String v_password = "postgre"; String v_database = "jdbc:postgresql://127.0.0.1/TEST"; PreparedStatement v_pstmt = null; try { DriverManager.registerDriver(new org.postgresql.Driver()); Connection v_conn = DriverManager.getConnection( v_database, v_username, v_password); v_conn.setAutoCommit(false); File v_file = new File("/home/postgre/someth! ing.jpg"); FileInputStream v_fis = new FileInputStream(v_file); v_pstmt = v_conn.prepareStatement( "insert into lob_test (id,data) values (?,?)"); v_pstmt.setInt(1,2); v_pstmt.setBinaryStream(2,v_fis,(int)v_file.length()); System.out.println("now you see me"); v_pstmt.executeUpdate(); System.out.println("now you don't"); v_conn.commit(); v_fis.close(); v_pstmt.close(); } catch (IOException e_io) { System.out.println(e_io); } catch (SQLException e_sql) { System.out.println(e_sql); } System.out.println("You'll only get here with the 7.1 driver!"); } } -- end -- 01010101010101010101010101010101010101010101010101 Marc P. Lavergne [wk:407-648-6996] Product Development richLAVA Corporation -- "Anyone who slaps a 'this page is best viewed with Browser X' label on a Web page appears to be yearning for the bad old days, before the Web, when you had v! ery little chance of reading a document written on another computer, a
Previous:From: Tom InnesDate: 2002-02-12 22:25:33
Subject: Re: [BUGS] Bug #581: Sequence cannot be deleted

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group