This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Updatin blob column in a table with file on my disk Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Updatin blob column in a table with file on my disk" Watch "Updatin blob column in a table with file on my disk" New topic
Author

Updatin blob column in a table with file on my disk

navi kumar
Ranch Hand

Joined: May 10, 2006
Posts: 47
Hi all,

Could someone help me!

I have a file called "FILE.txt" on my disk at c:/dir/FILE.txt

Now I want to upload this file into the following table.

Table NAME : ATTACHMENTS_TABLE

FILE_NAME varchar2(30)
FILE_CONTENT BLOB
ATTACHED_DT DATE

Can some one suggest how to get that file on my disk into the input Stream?

THanks for you help
Dan Howard
Ranch Hand

Joined: Feb 22, 2004
Posts: 47
You could read the whole file into a string and then simply assign the string:

navi kumar
Ranch Hand

Joined: May 10, 2006
Posts: 47
Dan, thanks for you reply

Can I give something like this:

String filePath = C:/dir/file.txt;

Regards,
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Updatin blob column in a table with file on my disk
 
Similar Threads
How do I insert a BLOB from a servlet
How to pass BLOB to a PL/SQL Stored Procedure
jpg to BLOB and BLOB to JPG
How do I insert an image into a database from a servlet?
write to a file in war