<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>
<%@ page import="java.sql.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title>Insert title here</title>
</head>
<body>
<%
String userName="root";
String userPassword="678663";
String url="jdbc:mysql://localhost:3306/stu?useUnicode=true&characterEncoding=gb2312";
String errorMessage="";
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection conn=DriverManager.getConnection(url,userName,userPassword);
if(conn!=null)
{
out.print("yes!");
}
else
{
out.print("wrong!");
}
}catch(Exception e)
{
errorMessage=e.toString();
out.print(errorMessage);
}
%>
</body>
</html>