WebSphere Portal Server - Servlet hangs and returns blank page

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Portal Server > October 2005 > Servlet hangs and returns blank page





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Servlet hangs and returns blank page

2005-10-24, 6:13 pm

Dear friends,

We have a servlet which adds binary data to an oracle BLOB fields. But in many occasions the servlet returns a blank page to the browser.

What are the possible reasons for this.

Here is the code of our servlet.

String CommentContent = req.getParameter("content");
ByteArrayInputStream bais = new ByteArrayInputStream(CommentContent.getBytes());
int length = req.getContentLength();
InitialContext ic = new InitialContext();
DataSource ds = (DataSource) ic.lookup("jdbc/MYDB");
Connection Con = ds.getConnection();
PreparedStatement pstmtupd = null;
String SQL = null;

SQL = "UPDATE ATTACHMENTS_TABLE SET FILE_CONTENT=? WHERE "
+ "REF_NUM='"+SelectedRef+"' AND FACILITY_DATE=to_date('"+LastFacilityDate+"','dd/MM/yy')";

pstmtupd = Con.prepareStatement(SQL);
pstmtupd.setBinaryStream(1, bais, length);
pstmtupd.execute();
pstmtupd.close();
bais.close();

Con.close();
session.setAttribute("CommentContent",CommentContent);
req.getRequestDispatcher("FinalCommentsViewNew.jsp").forward(req,resp);

Thanking You,
Chamal.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com