JSP and Mysql

How make connection between Jsp and Mysql
[48 byte] By [aurelian_cla] at [2007-11-26 14:55:27]
# 1

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>

jgalacambraa at 2007-7-8 8:43:58 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...