This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Store file in access Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Reply locked New topic
Author

Store file in access

visu Nekk
Ranch Hand

Joined: Sep 06, 2005
Posts: 122

using the above code i could read the file.Now can anyone guide me to store it in access or oracle database.Thanx in advance.

[added code tags]
[ September 21, 2005: Message edited by: Jeanne Boyarsky ]
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 32508
    
214

Visu,
You have the right idea with the commented out part. Good start!

I think you need to use a PreparedStatement since you are inserting a BLOB. It seems tough to represent a file in a SQL query. You can pass a byte[] or ByteArrayInputStream to the prepared statement.


[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
visu Nekk
Ranch Hand

Joined: Sep 06, 2005
Posts: 122
hi Jeanne,

i have tried out with prepared statement but the microsoft access driver does'nt support prepared statement.can u help me anyother way out?
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 32508
    
214

Visu,
Please don't post duplicate threads about the same question. Continue conversation in your other thread.

Thanks,
Jeanne
JDBC Forum Bartender
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Store file in access
 
jQuery in Action, 3rd edition