Hi,
Currently this is the situation. I am running a set of code that accesses (DB2 8.1 on WinXP) a table that stores file contents. The function is able to successfully insert a file into the record. However, I am unable to retrieve the BLOB contents during select.
Here is the insert
[1/18/05 0:31:47:031 SGT] 68c228e2 SystemOut O DSCN0389s2.JPG
[1/18/05 0:31:47:031 SGT] 68c228e2 SystemOut O image/pjpeg
[1/18/05 0:31:47:031 SGT] 68c228e2 SystemOut O wpsadmin
[1/18/05 0:31:47:031 SGT] 68c228e2 SystemOut O java.io.FileInputStream@2a3828f7
[1/18/05 0:31:47:031 SGT] 68c228e2 SystemOut O 1105979507031
[1/18/05 0:31:48:293 SGT] 68c228e2 SystemOut O File content inserted successfully. Row count = 1
Here is select.
[1/18/05 0:32:52:655 SGT] 329168f8 WebGroup I SRVE0180I: [PFSPortletApplication] [/.pfs] [Servlet.LOG]: DownloadFileServlet: init
[1/18/05 0:32:53:526 SGT] 329168f8 WebGroup E SRVE0026E: [Servlet Error]-[SQLGetByteArray]: java.lang.UnsatisfiedLinkError: SQLGetByteArray
at COM.ibm.db2.jdbc.app.DB2Blob.getBytes(DB2Blob.java :306)
at pmo.syabas.ibm.psf.databean.FileManagementService. getAFile(FileManagementService.java:226)
at pmo.syabas.ibm.psf.servlet.helper.DownloadFileServ let.doPost(DownloadFileServlet.java:35)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
Code snippet;
if (dbconn != null) {
sql0 = "select fsfid, fsfname, fsftype, fsfowner, fsfcontent, fsfdate, fsfsize from " + DBConnectionService.dbSchema + "PFSFILE where FSFID=?";
pstmt = dbconn.prepareStatement(sql0);
pstmt.setInt(1, p_fileID);
rs = pstmt.executeQuery();
if (rs.next()) {
lc_aFile = new PFSFile();
lc_aFile.setFileUID(rs.getInt("fsfid"));
lc_aFile.setFileName(rs.getString("fsfname"));
lc_aFile.setFileType(rs.getString("fsftype"));
lc_aFile.setFileOwnerID(rs.getString("fsfowner"));
bl = rs.getBlob("fsfcontent");
blobSize = rs.getInt("fsfsize");
lc_aFile.setBlobReadOut(bl.getBytes(1, blobSize)); // Died at getBytes.
lc_aFile.setFileDate(rs.getDate("fsfdate"));
lc_aFile.setFileTime(rs.getTime("fsfdate"));
lc_aFile.setFileSize(blobSize);
} // end If (rs.next())
} // End If
Some how I don't seem to understand why the following error occured only in WSAD Test environment. I am currently pleading to anyone who has encounter or solve such a problem for their technical advices.
I will gladly supply more information is necessary. Thank you in advance.