⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dbconnect.jsp

📁 基于servlet的图书馆管理系统,学习参考
💻 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 + -