you can refer to following site
http://www.javaalmanac.com/egs/index.html and choose
the java.sql package. u will get the required code
there.
JDBC is an API to access the database from java.
basically there are four types of drivers. Type four
is generally preferred. you can get tutorials abt JDBC
on sun`s site