<%@ page language="java" contentType="text/html" import="java.util.*" import="java.sql.*" pageEncoding="utf-8"%>
<html>
<head> <title> mysql </title></head>
<body>
<%
Class.forName("com.mysql.jdbc.Driver");
String url="jdbc:mysql://localhost:3306/student?user=root&password=410425";
Connection con=DriverManager.getConnection(url);
Statement stmt=con.createStatement();
String sql="select name from student";
ResultSet rs=stmt.executeQuery(sql);
out.print(rs);
stmt.close();
con.close();
%>
</body>
</html>
<html>
<head> <title> mysql </title></head>
<body>
<%
Class.forName("com.mysql.jdbc.Driver");
String url="jdbc:mysql://localhost:3306/student?user=root&password=410425";
Connection con=DriverManager.getConnection(url);
Statement stmt=con.createStatement();
String sql="select name from student";
ResultSet rs=stmt.executeQuery(sql);
out.print(rs);
stmt.close();
con.close();
%>
</body>
</html>