1,將IDEA工程導入Eclipse
1.1
1.2
1.3
1.4
2,連接MySql
MySql版本8.0,只能用JDK1.8
以下爲TomcatServer啓動時的錯誤:
Q:Data source rejected establishment of connection, message from server: “Too many connections”。
A:將my.ini中的最大連接數由151改爲1000,重啓MySQL。
Q:java.sql.SQLException: Unknown system variable ‘tx_isolation’
A:mysql-connector-java的版本太低,數據庫的版本太高 因此將mysql-connector-java升級到最新版本就解決了問題。
Q:Unsupported major.minor version 52.0 (unable to load class com.mysql.jdbc.Driver)
A:確定JDK版本。
Q:The server time zone value ‘�й���ʱ��’ is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration
A:增加時區參數:jdbc:mysql://localhost:3306/test?serverTimezone=UTC
3,JSP
3.1 jsp:include
include指令是靜態包含:
<%@include file="head.jsp" %>
include行爲是動態包含:
<jsp:include page="head.jsp"/>
3.2 c:forEach 循環
4, 步驟
創建實體,在數據庫建表,編寫DAO,測試DAO,抽取成DAO接口,編寫JSP,編寫JSP關聯的Servlet。
參考:
1.https://www.jianshu.com/p/7f01e7354c65
2.https://www.jianshu.com/p/7ed5cd1e1a45