It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Java Forum

Get Data from Text File to JSP

Get Data from Text File to JSP

Postby se7en on Fri Nov 07, 2008 7:24 am

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?
se7en
 
Posts: 2
Joined: Sat Oct 11, 2008 2:18 am

Who is online

Users browsing this forum: No registered users and 0 guests