It's not a secret anymore!
The moose likes JDBC and Relational Databases and the fly likes adding to a database using a servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "adding to a database using a servlet" Watch "adding to a database using a servlet" New topic

adding to a database using a servlet

J Derzaph

Joined: May 29, 2008
Posts: 7
I don't know if this is the right place to this question but I couldn't find a mysql forum. So, here goes...
I have a servlet that connects to a database. It connects just find, can search and return results but I can't get it to add a record. It doesn't throw any exceptions, it looks like its adding the record but when I check the database it isn't there.
I'm probably missing something really obvious but I'm stumped. Anyone have any ideas?
prash patil
Ranch Hand

Joined: May 26, 2008
Posts: 40
Hi J Derzaph ,
Can you add your servlet code? so it will be easy to look your problem..

sudhir nim
Ranch Hand

Joined: Aug 29, 2007
Posts: 212

Probably its the bug in your jdbc code.

[Servlet tutorial] [Servlet 3.0 Cook Book]
Yashpal Rawat

Joined: Jun 19, 2008
Posts: 4
Please ensure you are doing database commit in your servlet code.
Shrikant Kesarkar

Joined: Feb 08, 2008
Posts: 4
might be mysql database engine problem i.e. the code you are using
for saving object is not in accordance with mysql engine which is in use.
Try changing from innodb to myisam or vice versa.
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Please check your private messages regarding an important administrative matter.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: adding to a database using a servlet
It's not a secret anymore!