Why does it always fail to connect to the database in JSP?
I am using an online example. The corresponding jar package has been imported and the database is correct. Why is it always 22 lines of error?
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page import="java.io.*,java.util.*,java.sql.*"%>
<%@ page import="javax.servlet.http.*,javax.servlet.*" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
<html>
<head>
<title>SELECT </title>
</head>
<body>
<!--
JDBC URL
useUnicode=true&characterEncoding=utf-8
-->
<sql:setDataSource var="snapshot" driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/test1?useUnicode=true&characterEncoding=utf-8"
user="root" password="121314"/>
<sql:query dataSource="${snapshot}" var="result">
SELECT * from websites;
</sql:query>
<h1>JSP - </h1>
...