DEVPPL
http://www.devppl.com/forum/

Get Data from Text File to JSP
http://www.devppl.com/forum/viewtopic.php?f=47&t=12264
Page 1 of 1

Author:  se7en [ Fri Nov 07, 2008 8:24 am ]
Post subject:  Get Data from Text File to JSP

I have a text file named data.txt and the data inside are following:

Name,age,address,
xxx,17,ssssssssss,
yyy,29,qqqqqqqqqq,
zzz,24,tttttttttt,

I need to store it into mySQL, using JSP and/or Java.

In JSP
First field (row 0, column 1) : Name
Second field (row 0, column 2) : age
Third field (row 0, column 3) : address

(row 1, column 1) : xxx
(row 1, column 2) : 17
(row 1, column 3) : ssssssssss

(row 2, column 1) : yyy
(row 2, column 2) : 129
(row 2, column 3) : qqqqqqqqqq

(row 3, column 1) : zzz
(row 3, column 2) : 24
(row 3, column 3) : tttttttttt


And then store it in mySQL.
----------------------------------------------------
| | Name | age | address |
----------------------------------------------------
| 1 | xxx | 17 | ssssssssss |
----------------------------------------------------
| 2 | yyy | 29 | qqqqqqqqqq |
----------------------------------------------------
| 3 | zzz | 24 | tttttttttt |
----------------------------------------------------


I could find the java code on internet but just don't know how to write java code in JSP.
I'm using Eclipse and need to upload the text file to JSP first, but I can't read the text file(error: cannot be resolve).

Can anyone provide the code and brief explainations?

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/