sample code but i 'm posting the old driver class:
<%@ page contentType="text/html;charset=windows-1252" import="java.sql.*"%>
<%String success = "";
int x = 0;
try
{
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/market","root","jherald");
success="successfule"
conn.close();
} catch (Exception ex)
{ success="fail";
ex.printStackTrace();
}%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>untitled</title>
</head>
<body>
<%=success%>
</body>
</html>