Presentation is loading. Please wait.

Presentation is loading. Please wait.

MySQL, JavaBeans and File Upload

Similar presentations


Presentation on theme: "MySQL, JavaBeans and File Upload"— Presentation transcript:

1 MySQL, JavaBeans and File Upload

2 Download war file dbjavabean.war from the http://douap.uap.asia

3 Required Libraries in WEB-INF/lib folder

4 Digesting the JSP files.

5 File index.jsp

6 Eclipse path for the upload
Note that the upload code is included Change \ to / Replace the Eclipse path with the actual deployment path in Tomcat

7 Using the MyDB.java class

8 File MyDB.java Get only one record Store the values in a HashMap
Values are of type String

9 public HashMap<?,?> getMap()
Reading HashMap in index.jsp Set record id in MyDB bean From public HashMap<?,?> getMap()

10 Code of HashMap and ArrayList

11 Flow

12 Get more than one record
HashMap in an ArrayList Refresh content

13 Reading ArrayList in index.jsp
The Hashmap ArrayList

14 File upload.jsp Includes image resize, database, and upload.

15 Value of path is from index. jsp. Set it right before uploading
Value of path is from index.jsp. Set it right before uploading. Check for file permissions.

16 Understanding what is passed by the form
name and value pairs of the form

17 Retrieve the file and store it in the hard drive based on the path

18 For thumbnails, resizing the file based on the size
Store in the database

19 Update database

20 File slideshow.jsp Variable start dictates what the next image to show
Get all images,

21 Get one image

22 Test Upload using Eclipse Tomcat

23 Refresh Project Explorer to show the uploaded file.
Refresh page to reflect the uploaded image

24 Study the code. Recode the your menu using JavaBean.


Download ppt "MySQL, JavaBeans and File Upload"

Similar presentations


Ads by Google