Re: Need Help : taking data from JSP page and putting in MySQL database
- From: "tomtumelty@xxxxxxxxx" <tomtumelty@xxxxxxxxx>
- Date: 11 May 2007 14:30:00 -0700
On May 11, 3:14 pm, Philipp Taprogge <Philipp.Tapro...@xxxxxxx> wrote:
Hi!
Thus spake tomtume...@xxxxxxxxx on 05/11/2007 07:49 PM:
For some reason the data entered in the jsp page is not entered in the
database. I suspect the error is in the jsp (..maybe....)???? Any
suggestions ?
Hmm... perhaps I am missing something here, but you don't seem to
include any code that would store the data into the db. This is not
done automagically for a plain old webapp. You would have to create
and execute SQL statements yourself to store the fields.
For example, you could have multiple jsps with fields and a submit
button leading to the "next" jsp. Each page would add it's fields to
the bean data. But in the end, after the last submit, you would
still have to put all that stuff into the DB.
You could either do it in a jsp or, more cleanly, write a servlet to
handle the SQL and have it redirect to a jsp after it's done.
Retrieval of a DataSource would be done through JNDI, but there are
enough good tutorials for that out there.
Another approach to that same problem would be a so-called
object-relational mapper like Hibernate that would do the SQL-stuff
for you, but that might be overkill for what you are aiming at.
HTH,
Phil
The code that stores data in the database is written in stored
procedures and is called from a JavaBean. There are two beans, one
stores data and has the get and set methods. The other bean handles
the database connection and database manipulation. JDBC Mysql/
Connector J is being used to connect to the database. I should have
made this clear, thank you.
The problem seems to be getting the data from the jsp to the bean.
I keep looking at the JavaServer Pages O'Reilly book and googling but
not finding anything that helps yet.
Thak You very much.
.
- References:
- Need Help : taking data from JSP page and putting in MySQL database
- From: tomtumelty@xxxxxxxxx
- Re: Need Help : taking data from JSP page and putting in MySQL database
- From: Philipp Taprogge
- Need Help : taking data from JSP page and putting in MySQL database
- Prev by Date: Re: approach to upgrading
- Next by Date: Re: approach to upgrading
- Previous by thread: Re: Need Help : taking data from JSP page and putting in MySQL database
- Next by thread: approach to upgrading
- Index(es):