當我嘗試使用下面的代碼,上傳圖片,我收到以下錯誤:值java.sql.SQLException:ORA-01460:未實現或不合理的轉換要求錯誤而上傳圖像數據庫
File image = new File("D:/"+fileName);
preparedStatement = connection.prepareStatement(query);
preparedStatement.setString(1,"Ayush");
fis = new FileInputStream(image);
preparedStatement.setBinaryStream(2, (InputStream)fis, (int)(image.length()));
int s = preparedStatement.executeUpdate();
if(s>0) {
System.out.println("Uploaded successfully !");
flag = true;
}
else {
System.out.println("unsucessfull to upload image.");
flag = false;
}
請幫我一把。
DB腳本: CREATE TABLE ESTMT_SAVE_IMAGE ( NAME VARCHAR2(50), IMAGE BLOB )
對於一些用戶來說,這是通過獲取最新的JDBC驅動程序解決。 查看鏈接: http://forums.oracle.com/forums/thread.jspa?messageID=1808509和 http://forum.java.sun.com/thread.jspa?threadID=5164500&tstart=255 – Freak 2013-03-06 07:10:39