Hi,
First,you have to decide what type of driver you want to use. You need to download the oracle driver from the oracle site which includes classes1.zip or classes12.zip and put the zip file in the classpath.
Please refer, http://java.sun.com/docs/books/tutorial/jdbc/basics/index.html for more information on JDBC database connection.
Please refer, http://elab-nt1.bus.umich.edu/howto_oracle_servlet.html for the code example.
Hope that helps.
Regards,
Senthil Babu
Developer Technical Support
SUN Microsystems
http://www.sun.com/developers/support/