<%@page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="java.sql.*"%>
<html>
<body>
<%
String tablename=request.getParameter("tablename");
if(tablename==null)tablename="";
byte[] b=tablename.getBytes("ISO-8859-1"); tablename=new String(b);
out.println(tablename);
final String DRIVER = "org.gjt.mm.mysql.Driver";
final String DURL = "jdbc:mysql://localhost:3306/application";
final String DUSER = "root";
final String DPASS = "594daidai";
Connection conn = null;
try{
Class.forName(DRIVER);
}catch(ClassNotFoundException e){
e.printStackTrace();
}
try{
conn = DriverManager.getConnection(DURL,DUSER,DPASS);
}catch(SQLException e){
e.printStackTrace();
}
out.println(conn);
try{
conn.close();
}catch(SQLException e){
e.printStackTrace();
}
%>
</body>
</html>
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: An exception occurred processing JSP page /bookMinage/docreatetable.jsp at line 2825: }26: out.println(conn);27: try{28: conn.close();29: }catch(SQLException e){30: e.printStackTrace();31: }Stacktrace:org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:524)org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:435)org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
java.lang.NullPointerExceptionorg.apache.jsp.bookMinage.docreatetable_jsp._jspService(docreatetable_jsp.java:82)org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)javax.servlet.http.HttpServlet.service(HttpServlet.java:803)org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
<%@page import="java.sql.*"%>
<html>
<body>
<%
String tablename=request.getParameter("tablename");
if(tablename==null)tablename="";
byte[] b=tablename.getBytes("ISO-8859-1"); tablename=new String(b);
out.println(tablename);
final String DRIVER = "org.gjt.mm.mysql.Driver";
final String DURL = "jdbc:mysql://localhost:3306/application";
final String DUSER = "root";
final String DPASS = "594daidai";
Connection conn = null;
try{
Class.forName(DRIVER);
}catch(ClassNotFoundException e){
e.printStackTrace();
}
try{
conn = DriverManager.getConnection(DURL,DUSER,DPASS);
}catch(SQLException e){
e.printStackTrace();
}
out.println(conn);
try{
conn.close();
}catch(SQLException e){
e.printStackTrace();
}
%>
</body>
</html>
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: An exception occurred processing JSP page /bookMinage/docreatetable.jsp at line 2825: }26: out.println(conn);27: try{28: conn.close();29: }catch(SQLException e){30: e.printStackTrace();31: }Stacktrace:org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:524)org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:435)org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
java.lang.NullPointerExceptionorg.apache.jsp.bookMinage.docreatetable_jsp._jspService(docreatetable_jsp.java:82)org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)javax.servlet.http.HttpServlet.service(HttpServlet.java:803)org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)javax.servlet.http.HttpServlet.service(HttpServlet.java:803)