ankita balaji
For a new comer to Servlets and
JDBC, there is not a simple answer to your question. Nor will posting some random code help you out.
How familiar are you with JDBC right now? How familiar with Servlets? Technically, this is a 2 part question..
1. How do I use Servlets without using the web.xml file
2. How do I insert information from a web page into a MySQL database.
As far as #1 goes, Mark said it best in
this thread.
using Tomcat's invoker mapping (no longer a default in Tomcat) you can get to a servlet by /servlet/packagename.classname (Works in Resin too).
It's useful for testing, but I wouldn't want to use it in production use.
For #2 getting information from the submitted form is as simple as doing a request.getParameter("formElementName"). Then it's just a matter of doing a little JDBC. However, JDBC is better suited for the
JDBC Forum.
What I would recommend is that you begin by getting your servlets running. If you choose not to use the web.xml file, you'll probably have to hunt down some information on the relivent servlet containers (
Tomcat, Resin, etc) documentation to find out exactly how they suggest doing it. After you have some basic Servlet work down and you are comfortable with gathering data from a web form, move on to entering that information in a Database and ask those JDBC specific questions in the JDBC forum.
Hope that helps.