₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,696 members, 8,423,252 topics. Date: Tuesday, 09 June 2026 at 01:37 PM

Toggle theme

Java: How Can Write A File on Internet To A SQL Blob Field Directly? - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingJava: How Can Write A File on Internet To A SQL Blob Field Directly? (1472 Views)

1 Reply (Go Down)

Java: How Can Write A File on Internet To A SQL Blob Field Directly? by Desyner(op):
I want to write files directly from the internet via a URL object into a Blob field in MySQL. I don't want to store it as a normal file with extension before writing it to the DB.
Has anyone done this before? If yes, I need it.
Re: Java: How Can Write A File on Internet To A SQL Blob Field Directly? by Nobody: 4:50am On Oct 14, 2017
What do u mean file.

Files have extensions.

Mysql is a column db.

Besides that your using "insert into ...."

See w3c
Re: Java: How Can Write A File on Internet To A SQL Blob Field Directly? by Nobody: 1:15pm On Oct 14, 2017
Re: Java: How Can Write A File on Internet To A SQL Blob Field Directly? by Desyner(op): 11:35pm On Oct 14, 2017
proxy20:
Check this reference


http://www.java2s.com/Code/Java/Database-SQL-JDBC/StoreBLOBsdataintodatabase.htm
Oga that's not what I am looking for. I am looking for one that reads inputStream from a URL object directly in the Insert PreparedStatement. The one you provided is the simple and common way. I am not guaranteed full file io access when hosting my app so want to play safe by reading from the internet (URL Object) into SQL blob column.
Re: Java: How Can Write A File on Internet To A SQL Blob Field Directly? by ehinorlive: 12:33am On Oct 15, 2017
download the file from internet

store it as a variable or disk

insert into db

then delete from file

......

or save it as a variable

used a function to check if the variable Contain the file

if yes the. directly insert it into db
Re: Java: How Can Write A File on Internet To A SQL Blob Field Directly? by Desyner(op): 3:13am On Oct 15, 2017
@ehinorlive,
That's what I am avoiding. I want to stream the file from the internet via a URL object in to a db without saving it as a file in between.
Re: Java: How Can Write A File on Internet To A SQL Blob Field Directly? by Nobody:
Check stackoverflow
Re: Java: How Can Write A File on Internet To A SQL Blob Field Directly? by Desyner(op): 1:47am On Oct 19, 2017
proxy20:
Check stackoverflow
Not there. Seem a rare task and I plan to solve it as soon as I am less busy.
Re: Java: How Can Write A File on Internet To A SQL Blob Field Directly? by Nobody: 1:03pm On Oct 19, 2017
Desyner:
Not there. Seem a rare task and I plan to solve it as soon as I am less busy.
Ok
1 Reply

How Do You Write A Program That Delete Duplicate File On Your SystemHow Will I Check Locks In A SQL Server Database?Interested In Teaching Yourself Programming? file on link234

What Is The Best IDE For Programming Python And Django In 2019Acey Deucey Python And Just Basic CodeOffline Cbt