User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 456,528 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,781 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 2494 | Replies: 1
Reply
Join Date: Oct 2007
Posts: 13
Reputation: nikhita is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
nikhita nikhita is offline Offline
Newbie Poster

Solution uploading file using JSP to mysql database

  #1  
Oct 4th, 2007
suggest me a way on how to upload file using JSP to mysql database
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2006
Posts: 1,515
Reputation: masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light 
Rep Power: 10
Solved Threads: 136
masijade's Avatar
masijade masijade is online now Online
Posting Virtuoso

Re: uploading file using JSP to mysql database

  #2  
Oct 4th, 2007
Google "Java file upload", then rather than writing the stream you get from the request to a file, write it to a DB column using the setAsciiStream, setBinaryStream, or setCharacterStream of PreparedStatement, read the API for that method and the Sun Tutorials (or the MySQL documentation which comes with complete examples) for JDBC in general.


And use a Servlet, not a JSP. And regardless of which one you use, the DB stuff should not be a part of it. Rather that should be in a Bean (or some other external object), not the Servlet or JSP itself.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JSP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JSP Forum

All times are GMT -4. The time now is 4:18 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC