Home » Developer & Programmer » Forms » Exporting Blob to PDF File (Oracle 9i,Forms 6i - Client/Server)
Exporting Blob to PDF File [message #338000] Sat, 02 August 2008 03:00 Go to next message
mailtokkalyan
Messages: 65
Registered: December 2006
Location: Bangalore
Member

Hi,
I have inserted a PDF File into BLOB Column. But Now i want to export that Blob to PDF again. i have been tried with some java coding.
But i m getting
ORA-29532: Java call terminated by uncaught Java exception:
java.security.AccessControlException:
the Permission (java.io.FilePermission
\server\\users\Muthu\pdf\sample.rtf write)
has not been
granted to TRAINEE. The PL/SQL to grant this
is dbms_java.grant_permission( 'TRAINEE',
'SYS:java.io.FilePermission',
'\server\\users\Muthu\pdf\sample.rtf', 'write' )
ORA-06512: at "TRAINEE.EXPORTBLOB", line 0
ORA-06512: at line 8
But already i gave the grant permission to user.

Any one please tell me the actual problem. how to solve this issue.

Regards,
Kalyan.

[Updated on: Sat, 02 August 2008 03:02]

Report message to a moderator

Re: Exporting Blob to PDF File [message #338039 is a reply to message #338000] Sat, 02 August 2008 13:12 Go to previous messageGo to next message
Kevin Meade
Messages: 2101
Registered: December 1999
Location: Connecticut USA
Senior Member
I would guess you did not give the privelege like you thought.

Also, I am no expert using BLOBs. However, why not use a cursor or procedure parameter as in one of these to get at your blob value and forget about java and its privilege crap altogether:

create or replace procedure get_blob (pk_p in ...,blob_p out) as
begin
   begin
      select blobcolumn
      into blob_p
      from yourtable
      where pk = pk_p
      ;
   end;
end;
/
show errors

create or replace procedure get_blob (pk_p in ...,c1_p out sys_refcursor) is
begin
   open c1_p for
      select blobcolumn
      into blob_p
      from yourtable
      where pk = pk_p
      ;
end;
/
show errors


Kevin
Re: Exporting Blob to PDF File [message #338045 is a reply to message #338000] Sat, 02 August 2008 14:42 Go to previous messageGo to next message
Barbara Boehmer
Messages: 8636
Registered: November 2002
Location: California, USA
Senior Member
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:232814159006
Re: Exporting Blob to PDF File [message #338135 is a reply to message #338045] Sun, 03 August 2008 23:18 Go to previous messageGo to next message
mailtokkalyan
Messages: 65
Registered: December 2006
Location: Bangalore
Member

Dear,
I will explain you what is my actual problem.
I am using Client/Server only. (Forms 6i)
actually i want to store PDF files in Database.... and whenever i want to see or print, i will press a button, then it has to Display in acrobat reader.

This is what my actual issue. Please Tell me the solution.

Thanks in advance.

Regards,
Kalyan
Re: Exporting Blob to PDF File [message #338277 is a reply to message #338000] Mon, 04 August 2008 07:33 Go to previous message
Kevin Meade
Messages: 2101
Registered: December 1999
Location: Connecticut USA
Senior Member
I think you have some reading to do. Using the posted link from Barbara, I found this:

Quote:
I found the following solution - in the oracle documentation! - to download a blob to the browser:

(My blobs are in a table called "files" in the column "content" and the mime type of the content is
store in another table called "mimetypes" column "name". Master-Detail-Relationship.)

create or replace procedure download(p_file_id files.id%type)
as
  l_lob files.content%type; l_mime mimetypes.name%type;
begin
  select f.content, m.name
  into l_lob, l_mime
  from files f, mimetypes m
  where f.id = p_file_id
  and f.mimetype_id = m.id;
  owa_util.mime_header(l_mime, false);
  owa_util.http_header_close;
  wpg_docload.download_file(l_lob);
end;


Quote:
This worked on my 9i Rel. 2 DB.
I think this is the best way to do this - and it's already there in the DB!
So, an hour invested in reading the docus is a well invested hour.


Seems like this might be of use to you, but you will have to research the owa_util package, and the wpg_docload package.

Good luck, Kevin
Previous Topic: Foreign key in form!!!
Next Topic: how we upload a photo from my computer to the form?
Goto Forum:
  


Current Time: Fri Dec 09 07:46:24 CST 2016

Total time taken to generate the page: 0.08035 seconds