帮我看一下,这是什么错误?
我的的是Acess数据库
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
.....................
root cause
java.lang.NullPointerException
--------------------------------------------------------------------------------
Apache Tomcat/4.1.18
这是登入页面:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>登入</title>
<style type="text/css">
BODY { FONT-FAMILY:宋体; font-size:9pt}
TH { font-size:9pt}
td {color:#FF66FF;font-size:9pt}
</style>
</head>
<body>
<form method="post" action="confirm.jsp" >
<table align="center" border="0" cellpadding="0" width="332" bgcolor="#f0f8ff" bordercolorlight="#4da6ff" bordercolordark="#ecf5ff">
<tr>
<td colspan="2" align="center"><h4><font color="#9933FF">请登入</font></h4></td>
</tr>
<tr>
<td align="left">用 户:</td>
<td><input type="text" name="Sno"></td>
</tr>
<tr>
<td align="left">出生年月:</td>
<td ><input type="password" name="Sdate"></td>
</tr>
<tr>
<td align="left">姓名:</td>
<td><input type="password" name="Sname"></td>
</tr>
</table>
<input name="submit" type="submit" value="登入" align="middle">
</form>
</body>
</html>
这是验证页面:
<%@ page contentType="text/html;charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<html>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<head>
<title>验证页面</title>
</head>
<body bgcolor="#9999FF">
<jsp:useBean id="LoginBean" scope="request" class="jsjxpg.jsjxpg" />
<%
String number=new String(request.getParameter("Sno").getBytes("8859_1"));
String birthday=new String(request.getParameter("Sdate").getBytes("8859_1"));
String name=new String(request.getParameter("Sname").getBytes("8859_1"));
String sql="select * from studentTable where Sno='"+number+"' and Sdate='"+birthday+"'";
ResultSet rs=LoginBean.executeQuery(sql);
if (rs.next()){
rs.close();
LoginBean.closeStmt();
LoginBean.closeConn();
session.putValue("username",number);
%>
<script language="javascript">
window.location="../index.jsp?mark=登入成功"
</script>
<%}
else{
rs.close();
LoginBean.closeStmt();
LoginBean.closeConn();
String msg="登入有误";
session.putValue("Login_message",msg);
%>
<jsp:forward page="relog.jsp"/>
<%} %>
<p> </p>
</body>
</html>
这是数据库连接的javaBean
package jsjxpg;
import java.sql.*;
public class jsjxpg{
String sDBDriver="sun.jdbc.odbc.JdbcOdbcDriver";
String sConnStr="jdbc:odbc:jsjxpg";
private Statement stmt=null;
private Connection conn=null;
ResultSet rs=null;
public jsjxpg(){
try{
Class.forName(sDBDriver);
}
catch(java.lang.ClassNotFoundException e){
System.err.println("jsjxpg():"+e.getMessage());
}
}
public ResultSet executeQuery(String sql){
rs=null;
try{
conn=DriverManager.getConnection(sConnStr);
stmt=conn.createStatement();
rs=stmt.executeQuery(sql);
}
catch(SQLException ex){
System.err.println("aq.executeQuery:"+ex.getMessage());
}
return rs;
}
public void executeUpdate(String sql){
stmt=null;
rs=null;
try{
conn=DriverManager.getConnection(sConnStr);
stmt=conn.createStatement();
stmt.executeQuery(sql);
stmt.close();
conn.close();
}
catch(SQLException ex){
System.err.println("aq.executeQuery:"+ex.getMessage());
}
}
public void closeStmt(){
try{
stmt.close();
}
catch(SQLException e){
e.printStackTrace();
}
}
public void closeConn(){
try{
conn.close();
}
catch(SQLException e){
e.printStackTrace();
}
}
}
怎么回出现这样一个错误:
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
.....................
root cause
java.lang.NullPointerException
--------------------------------------------------------------------------------
Apache Tomcat/4.1.18
这是登入页面:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>登入</title>
<style type="text/css">
BODY { FONT-FAMILY:宋体; font-size:9pt}
TH { font-size:9pt}
td {color:#FF66FF;font-size:9pt}
</style>
</head>
<body>
<form method="post" action="confirm.jsp" >
<table align="center" border="0" cellpadding="0" width="332" bgcolor="#f0f8ff" bordercolorlight="#4da6ff" bordercolordark="#ecf5ff">
<tr>
<td colspan="2" align="center"><h4><font color="#9933FF">请登入</font></h4></td>
</tr>
<tr>
<td align="left">用 户:</td>
<td><input type="text" name="Sno"></td>
</tr>
<tr>
<td align="left">出生年月:</td>
<td ><input type="password" name="Sdate"></td>
</tr>
<tr>
<td align="left">姓名:</td>
<td><input type="password" name="Sname"></td>
</tr>
</table>
<input name="submit" type="submit" value="登入" align="middle">
</form>
</body>
</html>
这是验证页面:
<%@ page contentType="text/html;charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<html>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<head>
<title>验证页面</title>
</head>
<body bgcolor="#9999FF">
<jsp:useBean id="LoginBean" scope="request" class="jsjxpg.jsjxpg" />
<%
String number=new String(request.getParameter("Sno").getBytes("8859_1"));
String birthday=new String(request.getParameter("Sdate").getBytes("8859_1"));
String name=new String(request.getParameter("Sname").getBytes("8859_1"));
String sql="select * from studentTable where Sno='"+number+"' and Sdate='"+birthday+"'";
ResultSet rs=LoginBean.executeQuery(sql);
if (rs.next()){
rs.close();
LoginBean.closeStmt();
LoginBean.closeConn();
session.putValue("username",number);
%>
<script language="javascript">
window.location="../index.jsp?mark=登入成功"
</script>
<%}
else{
rs.close();
LoginBean.closeStmt();
LoginBean.closeConn();
String msg="登入有误";
session.putValue("Login_message",msg);
%>
<jsp:forward page="relog.jsp"/>
<%} %>
<p> </p>
</body>
</html>
这是数据库连接的javaBean
package jsjxpg;
import java.sql.*;
public class jsjxpg{
String sDBDriver="sun.jdbc.odbc.JdbcOdbcDriver";
String sConnStr="jdbc:odbc:jsjxpg";
private Statement stmt=null;
private Connection conn=null;
ResultSet rs=null;
public jsjxpg(){
try{
Class.forName(sDBDriver);
}
catch(java.lang.ClassNotFoundException e){
System.err.println("jsjxpg():"+e.getMessage());
}
}
public ResultSet executeQuery(String sql){
rs=null;
try{
conn=DriverManager.getConnection(sConnStr);
stmt=conn.createStatement();
rs=stmt.executeQuery(sql);
}
catch(SQLException ex){
System.err.println("aq.executeQuery:"+ex.getMessage());
}
return rs;
}
public void executeUpdate(String sql){
stmt=null;
rs=null;
try{
conn=DriverManager.getConnection(sConnStr);
stmt=conn.createStatement();
stmt.executeQuery(sql);
stmt.close();
conn.close();
}
catch(SQLException ex){
System.err.println("aq.executeQuery:"+ex.getMessage());
}
}
public void closeStmt(){
try{
stmt.close();
}
catch(SQLException e){
e.printStackTrace();
}
}
public void closeConn(){
try{
conn.close();
}
catch(SQLException e){
e.printStackTrace();
}
}
}
怎么回出现这样一个错误:
...全文
相关推荐
小学教师竞岗述职报告.docx
小学教师竞岗述职报告.docx
教师个人竞岗述职报告三篇.docx
教师个人竞岗述职报告三篇.docx
Spring Boot和SSH、SSM的区别,最全解释;SSH(Struts + Spring + Hibernate)、SSM(Spring + SpringMVC + MyBatis)
Spring Boot和SSH、SSM的区别,最全解释;SSH(Struts + Spring + Hibernate)、SSM(Spring + SpringMVC + MyBatis)
python爬取《你好, 李焕英》豆瓣评论数据
# 导入工具包 import requests from bs4 import BeautifulSoup import time import pandas as pd import numpy as np # 请求头 headers={'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.190 Safari/537.36'} # =
RT-Thread NANO V4.1.1 在Cortex-M0上移植踩坑记:解决内存分配宏导致的线程创建失败
本文详细记录了RT-Thread NANO V4.1.1在Cortex-M0平台移植过程中遇到的内存分配宏配置问题,导致线程创建失败的解决方案。通过分析内存管理算法宏定义,将RT_USING_SMALL_MEM替换为RT_USING_SMALL_MEM_AS_HEAP,成功解决了线程创建问题,为开发者提供了实用的移植经验。


Web 开发
