My Servlet code  is using a CachedRowSet to get a blob datatype from mySQL4 database  
using getBlob() function,from the table 
uploads(uploadid int(10),filename varchar(20),BINARYFILE BLOB);

using the following code.
              
            CachedRowSet rs;
            rs =new CachedRowSetImpl();
            rs.setCommand("SELECT * FROM uploads2");
            rs.execute(con);
            
            while(rs.next()){
                System.out.println("hi there");
                String s=rs.getString("filename");                              
//executes successfully
               
                java.sql.Blob image=                    
                rs.getBlob("BINARYFILE");
                 //throws exception
             }  
            catch(java.sql.SQLException s){
           System.out.println("SQLException:"+s.getMessage);
             }

---------jboss output console----------------
12:04:15,942 INFO  [STDOUT] hi there
12:04:15,942 INFO  [STDOUT] Type is :-4
12:04:15,942 INFO  [STDOUT] SQLException: Data Type Mismatch
12:04:15,942 INFO  [STDOUT] java.sql.SQLException: Data Type Mismatch
12:04:15,942 INFO  [STDOUT]     at com.sun.rowset.CachedRowSetImpl.getBlob(Unknown 
Source)
12:04:15,942 INFO  [STDOUT]     at com.sun.rowset.CachedRowSetImpl.getBlob(Unknown 
Source)
12:04:15,942 INFO  [STDOUT]     at 
dev.servlets.AccessTimerServlet.doPost(AccessTimerServlet.java:85)

---------------------------
kindly help me .
If I use simple ResultSet instead of CachedRowSet ,
then though it works but then ResultSets are not Serializable.(i.e the only reason i 
want to use CachedRowSet
beacuase they are Serializable)

Please help.

regards
robin 
----------------------------------------------

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3852990#3852990

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3852990


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to