Fail to write BLOB - no exception thrown

Поиск
Список
Период
Сортировка
От Craig Jarman
Тема Fail to write BLOB - no exception thrown
Дата
Msg-id 009e01c16b09$cd30a700$0a00a8c0@craig
обсуждение исходный текст
Список pgsql-jdbc
Hi
 
I am unable to write an image file into postgres using the jdbc7.1-1.2.jar driver.
Application server runs on NT, Postgres 7.1.3 on Linux 7.1.
No exception or error is generated and the transcation appears to go through.
Yet no record is recieved into postgres.
 
Code:
 
Class.forName("org.postgresql.Driver");
Connection conn = DriverManager.getConnection("jdbc:postgresql://192.168.0.50:5432/mydb","administrator","password");
File file = new File("d:/Temp/testimage.gif");
FileInputStream fis = new FileInputStream(file);
 
conn.setAutoCommit(false);
PreparedStatement ps = conn.prepareStatement("INSERT INTO IMAGES VALUES (?, ?)");
ps.setString(1, file.getName());
            
Long  length = new Long(file.length());
ps.setBinaryStream(2, fis,length.intValue());
ps.executeUpdate();
ps.close();
fis.close();
 
This code works for other dbs. 
______________________________
 
Craig Jarman
Source IT
Ph: 612 9974 1480
Fx: 612 9974 1280
cjarman@source.com.au
______________________________

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: SQLException: ERROR: oidin: when loading GIF file
Следующее
От: Stuart Robinson
Дата:
Сообщение: Re: JDBC inserts on views using rules