BLOB

Hello,

I would like to insert a Blob into a oracle table. I'd like to do it without the empty_blob procedure.

I've been looking for a solution in Internet and I've found that a standard way is the next one:

Class.forName("oracle.jdbc.driver.OracleDriver");

Connection connection = DriverManager.getConnection("jdbc:oracle:thin:@128.90.111.145:1521:producto10G", "PRUSOL","PRUSOL");

PreparedStatement stmt = connection.prepareStatement("INSERT INTO IVOLVOLTBL VALUES (?,?,?,?,?,?,?)");

File file = new File ("c:\\bbk.jpg");

FileInputStream fis = new FileInputStream (file);

stmt.setString(1, "AAAA");

stmt.setInt(2, 1111);

stmt.setInt(3, 1111);

stmt.setInt(4, 1111);

stmt.setInt(5, 1111);

stmt.setString(6, "617");

stmt.setBinaryStream(7, fis, (int)file.length());

stmt.execute();

connection.close();

fis.close();

But when I run the program, and the file size is bigger than a few kb, the next exception is thrown: ORA-01460: unimplemented or unreasonable conversion.

I'm ussing oracle drivers ojdbc14.jar.

What am I doing wrong?

Thanks in advanced !!

[1188 byte] By [egesra] at [2007-11-27 2:08:20]
# 1
I found what the problem was !!!I was trying with one version of the ojdbc14 library. But it should be an old version of the library, because when I've donwloaded the last version of the ojdbc14 library (10g), it started to work.
egesra at 2007-7-12 1:57:37 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2
Not a good idea to put your SIDD and PWD out there - might want to erase those.
abillconsla at 2007-7-12 1:57:37 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...