How do I access a database from my servlet or JSP?
JDBC allows you to write SQL queries as Java Strings, pass them to the database, and get back results that you can parse. To access database from your servlet, make sure JDBC driver for the database you are accessing is accessible to Web Server (Tomcat). For example, in Tomcat to access Oracle database through JDBC driver for Oracle, you need to place classes111.zip (renamed to classess111.jar) or classes12.jar in /WEB-INF/lib directory of the application or /common/lib directory of Tomcat.