If you are going to handle database connections yourself instead of delegating that job to the servlet container, then you need to put the database driver's jar file into your web application. The correct place to put it is in the WEB-INF/lib folder.
Paul Clapham wrote:If you are going to handle database connections yourself instead of delegating that job to the servlet container, then you need to put the database driver's jar file into your web application. The correct place to put it is in the WEB-INF/lib folder.
I already gave you all the details. Those are all the details.
No, you don't have to set the classpath for your servlet container. Just deploy the database driver jar as part of your application as I described.
And do make sure you actually recompile your code to refer to the correct driver and deploy that recompiled code. Last time you didn't, because you got this error message:
Rupali Kulkarni wrote:Which .Jar file do i need to use? where it's located?
Oh dear. Does this mean you haven't even downloaded the JDBC driver yet? If that's the case then I'm willing to bet that you aren't running a MySQL server on your computer. Is that right?
At any rate your first step is to decide which database you're actually going to use. So far you have asserted that you are using three different databases. There's no point in continuing until you are sure which one you plan to use.
In that case get rid of all the code which refers to MySQL and to SQL Server, and replace it by code which loads the Oracle driver and connects to the Oracle database. Make sure you know where the database is running -- do you have a database already running somewhere which you have to connect to, or do you have to run your own server instance? At any rate make sure you use the right computer name in your JDBC URL.
As for the jar file, you will need to get the Oracle JDBC driver jar which corresponds to the version of the Oracle database you plan to connect to. And where do you need to put that jar? I have told you that twice already. Please don't ask questions if you don't intend to read the answers you get.
And as for servlets: I suggest you follow Pat's advice and forget about servlets for now. There are plenty of things wrong with the servlet code you posted, but going into them would be a distraction. Just focus on JDBC and get that working.