#1
  1. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2002
    Posts
    26
    Rep Power
    0

    Unhappy drivers for blobs???


    hi,

    I am running an JSP application which selects and inserts blobs in to ORACLE...

    The application runs fine in my local machine but when I upload it to the server, I keep gettin an Internal Server Error "javax.servlet.ServletException"

    I comment the lines "doc = rs.getBlob("blobs");" and the page loads fine but ofcouse without the blob...

    I copied all the drivers i had to the server but nothing...

    can anyone help me out!!??

    TIA,
    sands
  2. #2
  3. No Profile Picture
    Java Developer
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Posts
    5
    Rep Power
    0
    What does the code look like?

    Do you realise you can't treat it just like a stream, you need to get an input/ouputstream to it from the reference to it to write/read to it

    Oscagne
  4. #3
  5. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2002
    Posts
    26
    Rep Power
    0
    yes, i understand what u mean and yes I am using streams later on.. but the exception occurs right when i try to get the blob from the table...

    hv checked and rechecked all the drivers, classpaths etc... and they look exactly the same as my localhost...
    dunno whats happening...

    PHP Code:

    // NOTE: this is an JSP page.. used the php for syntax highlighting...


      
    Statement stm db.connection.createStatement();
     
        
    out.println("helloo");
    String dc null;
            
    Blob doc null;
        
    String contype null;        

        
    String SQL "SELECT DOCUMENT.code,DOCUMENT.doc,DOCUMENT.content_type FROM DOCUMENT WHERE DOCUMENT.document_code ='6itqr001' AND DOCUMENT.version='1'";

        
    System.out.println("\n\nDetail Query\n\n" SQL);    
         
    ResultSet rsd stm.executeQuery(SQL);
            
         while(
    rsd.next()) { 
        
        
    dc rsd.getString("code");
        
        
    doc =  rsd.getBlob("doc"); 
  6. #4
  7. No Profile Picture
    Java Developer
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Posts
    5
    Rep Power
    0
    It's a while since I've done this, but I'm sure I used the oracle dbms_lob.read and dbms_lob.write db procedures to read and write them.

    I take it you say you aren't throwing errors if you remove this line, means that you are removing all the line refering to that variable aswell, so it may not be that line...why don't you put a try arount it and print the stack trace in the catch, that'll narrow it down.

    Also I think I might have had to use the Oracle blob type rather than the java.sql one, as they may differ per JDBC connection type, but this is just a vague memory, I may be wrong

    Oscagne

IMN logo majestic logo threadwatch logo seochat tools logo