📄 dbconnect.jsp
字号:
<%@ page import="sjservlets.*, java.sql.*" %>
<%
ConnectionPool connectionPool;
int vendor = DriverUtilities.MYSQL;
String driver = DriverUtilities.getDriver(vendor);
String host = "localhost";
String dbName = "jsp_library";
String url = DriverUtilities.makeURL(host, dbName, vendor);
String username = "root";
String password = "masteryoda";
try {
connectionPool =
new ConnectionPool(driver, url, username, password, 10, 50, true);
} catch(SQLException sqle) {
System.err.println("Error making pool: " + sqle);
getServletContext().log("Error making pool: " + sqle);
connectionPool = null;
}
// connectionPool.closeAllConnections();
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -