Forums Register Login

How to insert form-data(.jsp) into MySql through Servlets

+Pie Number of slices to send: Send
hi ,

I have a .jsp file which has a form , and that data goes to servlet and I want to pass all those datas into MYsql (in a particular database and particular table).

I am trying to make a 3-tier application. JSP being being the view , Servlets the Controller and MYsql being the database.

Hope to have the overview of the logic doing this.

Regards,


+Pie Number of slices to send: Send
What, specifically, are you having an issue with? Getting the form data? Using the DB?
+Pie Number of slices to send: Send
hi David its with the DB.....

cant use the prepared statement...
+Pie Number of slices to send: Send
 

Thamu Gurung wrote:cant use the prepared statement...


What did you try? And, what was happened when you tried? Please TellTheDetails
+Pie Number of slices to send: Send
Without having enough details how you expect us to help you? Post the code where error resides....
+Pie Number of slices to send: Send
hi ,

The error msg which i'm getting is like this :-

java.sql.SQLException: Column count doesn't match value count at row 1

My files are like this

1.form.jsp



2. insertData.java



3. Table creation in MYSQL
-

4. Web.xml file



Please Help in this

Regards,
+Pie Number of slices to send: Send
Is there a trigger on the table?
+Pie Number of slices to send: Send
No, there is no trigger in the table..
+Pie Number of slices to send: Send
What if you try ?


It should be working.
+Pie Number of slices to send: Send
That is well spotted, Fatih!
+Pie Number of slices to send: Send
yah ,

thankyou its working now ,, as simple mistakes ,,makes crazy ,,

please check my JSP thread,,i got problem there
+Pie Number of slices to send: Send
Hey This Program works fine.
What are your superhero powers? Go ahead and try them on this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 34019 times.
Similar Threads
regarding JTable
Retrieve binary file from database and send to user via web browser
reading pdf's table problem
How to store an oracle database table's data to an excel file?
How to store a table's data from oracle database into an excel file?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 14:13:20.