I have a simple question, Can I retrieve data from the Mysql database on page load. i.e i am storing the information from page one and i want to retrieve that stored information on my page two. And this should be retrieved on page load.
Is this possible, if yes could anybody guide me with some tips.
Are you talking about web pages? If so, retrieve the data as page one is being created and store the results in a session attribute. You can simply write the data to the page for page one. For page two, have it simply pull out the data from the session attribute and write the data to the page.
Well the question isn't clear, but I will take a stab at it anyway. The short answer is no matter which meaning you have it can be done.
If by 'page' you mean servlet/jsp and by 'load' you mean on 'request' then you can access get data in page 1 and access it in page 2. This can be done by putting the data into session, request, application, page, or static scope among others. In jsp these are all implicit variables.
If by 'page load' you mean when the servlet/jsp is first loaded it can also be done by coding the servlets 'jspInit' method or the servlets 'init' method.