March 5th, 2002, 12:12 PM
drivers for blobs???
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!!??
March 5th, 2002, 12:44 PM
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
March 5th, 2002, 01:35 PM
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...
// NOTE: this is an JSP page.. used the php for syntax highlighting...
Statement stm = db.connection.createStatement();
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);
dc = rsd.getString("code");
doc = rsd.getBlob("doc");
March 7th, 2002, 06:21 PM
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