代码如下,为什么连不上数据库? <%@page contentType="text/html" pageEncoding="UTF-8" %> <%@page import="java.sql.*"%> <html> <head> </head> <body> <center> <h1>登陆操作</h1> </center> <hr> <%!//定义若干个数据库连接常量 public static final String DBDRIVER ="com.mysql.jdbc.Driver"; public static final String DBURL = "jdbc:mysql://localhost:3306/carmanage"; public static final String DBUSER = "root"; public static final String DBPASS = "root"; boolean flag = false; String name = null; %> <% Connection conn = null; //数据库连接 PreparedStatement pstmt = null; //数据库预处理操作 ResultSet rs = null; //查询要处理结果集 %> <% try{ %> <% Class.forName(DBDRIVER); conn &#
jsp登陆界面连接mysql数据库_jsp连接mysql数据库实现登录
最新推荐文章于 2024-06-08 12:26:07 发布