Re: Need Help : taking data from JSP page and putting in MySQL database



Hi!

Thus spake tomtumelty@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
.