jQuery in Action, 3rd edition
The moose likes JDBC and Relational Databases and the fly likes how to upload files to My sql with jsp and what is the query to check in database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "how to upload files to My sql with jsp and what is the query to check in database" Watch "how to upload files to My sql with jsp and what is the query to check in database" New topic
Author

how to upload files to My sql with jsp and what is the query to check in database

P Arunkumar
Ranch Hand

Joined: Jan 05, 2012
Posts: 119
Hi

I need to upload some files to database(mysql), i developed my presentation logic by jsp. iam new to development field, please help me how i can upload files in database with example.


i have created my database table as : Create table file(file_data mediumblob);

What java code to upload file in database, after uploading in database what query i can use to check in database.


Please help me,Its my first project, i Don't have any guide to solve my problem, please help me.


Thanks in advance,

Thanks & Regards,
Jenifer Rajkumar.
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3749
    
  10

I recommend trying to upload a file to a database without using a JSP to get some practice, then combine it with a JSP for the full solution (without putting JDBC inside of a JSP as this is a horrible practice).


[OCA 8 Book] [Blog]
P Arunkumar
Ranch Hand

Joined: Jan 05, 2012
Posts: 119
Hi

Thank you for kind information,

i don't know how to upload a file in database, it can be with java also for me great fine. but i need to upload or store some files into the database.

Please send me with some example, because iam beginner and new to java.


Thank you in advance.
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3719
    
  61

Jenifer Rajkumar wrote:Please send me with some example, because iam beginner and new to java.

This is what tutorials have been invented for. Anyone trying to access database from Java should read a JDBC tutorial thoroughly. You might try this tutorial, for example.

Files are usually stored in BLOB fields and blobs manipulation is covered by most JDBC tutorials. Searching for "BLOB" here on Javaranch will undoubtedly bring up some examples too. If something is still unclear afterwards, come back here and ask specific questions; you'll obtain much better response that way.
P Arunkumar
Ranch Hand

Joined: Jan 05, 2012
Posts: 119
Hi


I read the tutorial, but still i can't get answer for my question please help me to upload file into database useing java.

Please send me a bit of code to upload file,


Thanks in advance.
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3719
    
  61

Jenifer Rajkumar wrote:I read the tutorial, but still i can't get answer for my question please help me to upload file into database useing java.

The tutorial contains lots of examples, including ones regarding CLOBs/BLOBs. Didn't you see them?

Look carefully at the code examples in the tutorial. If something is not clear, try reading the Java documentation of the methods that seem unclear to you. If it's still hazy, come back here, show us the code you've written and tell us what does not work as you'd expect. We'll be glad to answer specific question.

You might also want to read ShowSomeEffort, NotACodeMill or generally all in the HowToAskQuestionsOnJavaRanch (just click on these words).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to upload files to My sql with jsp and what is the query to check in database
 
It's not a secret anymore!