• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

write a bytearray to an oracle db

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello all,
i have a big problem with writing a bytearray to an oracle db and display it via a servlet
i have a function to generate a pdf with the pdflib

then i want to store the bytebuffer = pdf.get_buffer(); into an oracle database with this script:

when i then try to display the result with this servlet then i get no pdf file displayed

has anybody an idea where my error is ?
tia
andreas spiessl
 
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
You can read this post: https://coderanch.com/t/297456/JDBC/java/Retreiving-image-JDBC
/Rene
 
snoofle
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello rene, hello all
i have tried it with the code and no pdf file is displayed.
i have test my loading servlet with the database an i function, so now i think the error must be in

has anybody an idea
tia
andreas spiessl
[ June 19, 2002: Message edited by: andreas spiessl ]
 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could you insert the pdf files in the database successfully?
Try to get the size of the blob and match it with the actual file and make sure that it is loaded properly.
What version of adobe acrobat are you using? I had several problems displaying the pdf files on the browser, especially with some versions of IE. Have you tried to refresh the browser? I am using bfiles instead of blob to store the pdf files. If you like I can give my code to display the pdf files in the browser.
Regards
Beksy
[ June 19, 2002: Message edited by: Beksy Kurian ]
 
Rene Larsen
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
This is the way I saves a byte[] in a Blob:

I do not use the Oracle Blob (getBLOB() is from Oracle and getBlob() is standard) and OracleResultSet, but the one from the standard JDBC API
/Rene
[ June 19, 2002: Message edited by: Rene Larsen ]
 
snoofle
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello beksy,
i am using ie 4/5 and acrobat 5.
the insert doesn't work correctly,
(maybe the pdflib get_buffer function has an error)
i don't know where my error is ...
i would be nice if i can have a look at your code for insert and displying pdf files
tia
andreas spiessl
[ June 19, 2002: Message edited by: andreas spiessl ]
 
Rene Larsen
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
You have to change the way you generate your pdf-doc.
I have tested your implementation and it is not working, but this code is:

Saving and loading the pdf-doc is the way shown earlier.
Hope this helps
/Rene
[ June 20, 2002: Message edited by: Rene Larsen ]
 
snoofle
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello rene,
you've been right
pdf.close() and after that pdf.get_buffer() was the error
thanks a lot
andreas spiessl
 
CAUTION! Do not touch the blades on your neck propeller while they are active. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic