Connecting to Databases
servlets connect to databases through JDBC
- In the init() method connect to the database.
public void init (ServletConfig cfg)
throws ServletException {
String name = cfg.getInitParameter("driver");
con = DriverManager.getConnection (urlString);