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 Insert Quert return value 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 "Insert Quert return value" Watch "Insert Quert return value" New topic
Author

Insert Quert return value

Ramkumar Subburaj
Ranch Hand

Joined: Sep 07, 2007
Posts: 83
Hello,

I am trying upload file from a JSPfile using MiltipartUpload API.

When the user selects the file and clicks the upload button, the request goes to a servlet where i am inserting the image file name into the db and writing the file to the disk.

I am using MySQL 5.0.24

It is taking atleast 2 minutes for the servlet to complete the process.

Thougth the image name is inserted into the db successfully, the insert query is returning 0.

can anyone pleasehelp?


SCJP 1.5, SCWCD 1.4.
Hanging between Web Services and EJB
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


Thougth the image name is inserted into the db successfully, the insert query is returning 0.

Is this an issue? Why do you need the return value?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Ramkumar Subburaj
Ranch Hand

Joined: Sep 07, 2007
Posts: 83
i got the solution for this. one of the fields in my table had a size of 10 characters and i was sending more than 10 characters through my query.
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3703
    
    5

Shouldn't there have been a SQL exception then alerting you to the problem?


My Blog: Down Home Country Coding with Scott Selikoff
Brij Garg
Ranch Hand

Joined: Apr 29, 2008
Posts: 234
I hope while inserting you must be using executeQuery method.
This method returns ResultSet.

So how return value can be 0.

Please correct me if I am wrong.
 
 
subject: Insert Quert return value
 
Similar Threads
Uploading Image from jsp to database via servlet
How to upload only image file
Image Upload - Jsp or servlet
File Upload Problem(Database and Dirctory)
Not able to insert image more than 4K in Database