<%@ page import="java.sql.*" %>
<%@ page import="java.util.*" %>
<%
Connection connection=null;
try{
Class.forName("com.mysql.jdbc.Driver");
connection= DriverManager.getConnection("jdbc:mysql://localhost:3306/social_network","root","Apsa@123");
}
catch(Exception e)
{
System.out.println(e);
}
%>
我收到以下异常
<块引用>java.lang.NullPointerException:无法调用 “java.sql.Connection.createStatement()”因为“connection”为空