标题:[求助]SQL和JSP的连接
取消只看楼主
sohard
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2006-5-16
 问题点数:0 回复次数:4 
[求助]SQL和JSP的连接

我的conn.jsp内容如下

<%@include file="head.html"%>
<%@ page session="true" %>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.sql.*,java.lang.Double.*" %>
<%//加载驱动程序类
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
String
url="jdbc:microsoft:sqlserver://localhost:1433;DatebaseName=shoppingmall";
//数据源
String id="sa";
String password="";
//建立数据库连接
Connection conn=DriverManager.getConnection(url,id,password);
CallableStatement cstmt=null;
ResultSet rs=null;
String strSql;
String user; //保留登陆客户的ID
String sysuser;
String sysuserType;
String action; //页面动作%>

错误如下

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
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause

java.lang.NullPointerException
	org.apache.jsp.bysj.CustomerLogin_jsp._jspService(CustomerLogin_jsp.java:124)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.

我的系统是XP2 SQL2000 SP3补丁,请高手帮我解决下,非常感谢!~~~~

搜索更多相关主题的帖子: SQL JSP java import 
2006-05-16 13:17
sohard
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2006-5-16
得分:0 

classpath
.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;%CATALINA_HOME%\common\lib\servlet-api.jar;C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib

是这样吗?

2006-05-16 17:49
sohard
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2006-5-16
得分:0 

楼上的大哥 空指针异常 是什么原因?

2006-05-17 14:35
sohard
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2006-5-16
得分:0 
2006-05-18 23:26
sohard
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2006-5-16
得分:0 

谢谢,谢谢!~~~~

2006-05-20 00:29



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-64669-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.104440 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved