Write a program using servlet and JDBC for developing an onine application to create a database?

// You can use this sample servlet as a starting point to connect to
// your database included with useractive account.
//
// Portions copied from Sun's HelloWorldServlet.java
// You are free to use this code in any way you chose

import java.io.*;

import javax.servlet.*;
import javax.servlet.http.*;

import java.sql.*;

public
class HelloWorldServlet extends HttpServlet {

public void doGet (HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
res.setContentType("text/html");

ServletOutputStream out = res.getOutputStream();
out.println("<html>");
out.println("<head><title>Hello World</title></head>");
out.println("<body>");

try {
// The newInstance() call is a work around for some
// broken Java implementations
out.println("asdf");
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
}
catch (Exception E) {
out.println("Unable to load driver.");
E.printStackTrace();
}

out.println("<br><hr>");

try {
Connection Conn =
DriverManager.getConnection("jdbc:mysql://sql.useractive.com/USERNAME?user=USERNAME&password=PASSWORD");

// Do something with the Connection
Statement Stmt = Conn.createStatement();
ResultSet RS = Stmt.executeQuery("SELECT * from SOMETABLE");

while (RS.next()) {
out.println(RS.getString(1));
}
// Clean up after ourselves
RS.close();
Stmt.close();
Conn.close();

}
catch (SQLException E) {
out.println("SQLException: " + E.getMessage());
out.println("SQLState: " + E.getSQLState());
out.println("VendorError: " + E.getErrorCode());
}

out.println("<h1>Hello World. Sun... 1.4</h1>");
out.println("</body></html>");
}

public String getServletInfo() {
return "Create a page that says <i>Hello World</i> and send it back";
}
}