ServletContextListener is helpful in informing about context Initilazation and destruction. In a typical content management web system, there is normally a database behind. The example below demonstrates how to connect MySQL database during context initialization stage. Create a dynamic web project TestServlet, import the connector. The jar file will be in the lib directory. Create a database "testdb" and a table "user".
Join Stack Overflow to learn, share knowledge, and build your career. Connect and share knowledge within a single location that is structured and easy to search. I am using windows 8. In my database I created one table named as city with column name address and inserted one data 'xyz' to the table city. Where i am wrong?
L et us see how to connect servelet application with Oracle database , for time being i am considering Oracle XE. Hello sir! Can anyone explain filters in detail with code segments? Thankx a lot.
There are given 6 steps to create a servlet example. These steps are required for all the servers. The mostly used approach is by extending HttpServlet because it provides http request specific method such as doGet , doPost , doHead etc. The directory structure defines that where to put the different types of files so that web container may get the information and respond to the client. The Sun Microsystem defines a unique standard to be followed by all the server vendors.