This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to store and retrieve word file from sybase  RSS feed

 
Shiva Battula
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can anyone help/provide me some examples/URLS to store and retrieve word file from sybase database in Jsps/Servlets?
Thanks,
Sivasankar
 
Rusty Smythe
Ranch Hand
Posts: 93
Mac Objective C Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This will help: Show some effort

Here's is the general approach I would take:

Storing
1) Upload word file from user to server
2) Read file as a stream, write that stream to the database (probably to a BLOB column)
3) Delete file on server

You could probably just read the upload stream and write to the database in one step; then you wouldn't have to clean up anything or worry about local disk space.

Retrieving
A) Stream data from db to HttpServletResponse, setting the mime type to the one appropriate for MS Word.
[ August 22, 2006: Message edited by: Rusty Smythe ]
 
Shiva Battula
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rusty,
Thank you. Its very first time for me to work with BLOBs and Sybase.
Iam able to get byte array from uploaded file in servlet.
I was stuck while storing byte array ( from word document ) to DB.I need some help on how to create BLOBS from byte array?
Could you please help me out on this?

Thanks,
Sivasankar
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66204
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to the JDBC forum.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!