Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC / Oracle / Blob: compatibility problem

 
Mike Himstead
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a problem browsing a result set containing a single result with a Blob from an Oracle DB. Debugging shows that the result set does contain the Blob (I can see the byte array), but when I try to get it with:


Note: Blob is java.sql.blob, rowset is of type sun.jdbc.rowset.CachedRowSet


I get an Exception:

Exception: [B incompatible with java/sql/Blob
Stack Trace:
java.lang.ClassCastException: [B incompatible with java/sql/Blob
at sun.jdbc.rowset.CachedRowSet.getBlob(CachedRowSet.java:5235)
at sun.jdbc.rowset.CachedRowSet.getBlob(CachedRowSet.java:5375)
at de.volkswagen.ipad.tv.model.service.impl.ProtocolServiceImpl.createFileDateDTO(ProtocolServiceImpl.java:336)
at de.volkswagen.ipad.tv.model.service.impl.ProtocolServiceImpl.downloadProtocol(ProtocolServiceImpl.java:304)
at de.volkswagen.ipad.tv.controller.SearchProtocolAction.execute(SearchProtocolAction.java:101)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at de.volkswagen.ipad.servlets.IpadControllerServlet.process(IpadControllerServlet.java:113)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1577)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1521)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:136)
at de.volkswagen.ipad.util.monitoring.IpadMonitor.doFilter(IpadMonitor.java:471)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:142)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:121)
at de.volkswagen.ipad.util.filter.FilterSessionInitializer.doFilter(FilterSessionInitializer.java:70)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:142)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:121)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:82)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:759)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:89)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1936)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:114)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:472)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:411)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:101)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:566)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:619)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:952)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1039)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1471)

As far as I know, there aren't different Blob types on Oracle, so what might cause this problem?
 
Paul Campbell
Ranch Hand
Posts: 338
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic