我在用dataSource连接数据库时,出现以下错误:
type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception javax.servlet.ServletException: Unable to get connection, DataSource invalid: "java.sql.SQLException: I/O Error: SSO Failed: Native SSPI library not loaded. Check the java.library.path system property."
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
org.apache.jsp.ch12.store_jsp._jspService(org.apache.jsp.ch12.store_jsp:111)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "java.sql.SQLException: I/O Error: SSO Failed: Native SSPI library not loaded. Check the java.library.path system property."
org.apache.taglibs.standard.tag.common.sql.UpdateTagSupport.getConnection(Unknown Source)
org.apache.taglibs.standard.tag.common.sql.UpdateTagSupport.doStartTag(Unknown Source)
org.apache.jsp.ch12.store_jsp._jspx_meth_sql_update_0(org.apache.jsp.ch12.store_jsp:276)
org.apache.jsp.ch12.store_jsp._jspx_meth_c_when_0(org.apache.jsp.ch12.store_jsp:251)
org.apache.jsp.ch12.store_jsp._jspx_meth_c_choose_0(org.apache.jsp.ch12.store_jsp:218)
org.apache.jsp.ch12.store_jsp._jspService(org.apache.jsp.ch12.store_jsp:90)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.下面是web.xml中的相关参数:
<!-- Used by the JSTL database actions -->
<context-param>
<param-name>
javax.servlet.jsp.jstl.sql.dataSource
</param-name>
<param-value>
jdbc:jtds:sqlserver://ASUS:1433;DatabaseName=tempdb
</param-value>
</context-param>以下我连接处理页面的源代码:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %><sql:setDataSource var="example" scope="application"
driver="net.sourceforge.jtds.jdbc.Driver"
url="jdbc:jtds:sqlserver://ASUS:1433;DatabaseName=wind"
user="sa"
password="sa"
/>
<%--
See if the student is already defined. If not, insert the
info, else update it.
--%>
<sql:query var="stuInfo" dataSource="${example}">
SELECT * FROM student
WHERE StudentID = ?
<sql:param value="${param.studentID}" />
</sql:query><c:choose>
<c:when test="${stuInfo.rowCount == 0}">
<sql:update>
INSERT INTO student
(StudentID,StudentName, Password, Dept, Major, DormNum,
DormTel, MobileNum, EmailAddr)
VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)
<sql:param value="${param.studentID}" />
<sql:param value="${param.studentName}" />
<sql:param value="${param.password}" />
<sql:param value="${param.dept}" />
<sql:param value="${param.Major}" />
<sql:param value="${param.DormNum}" />
<sql:param value="${param.DormTel}" />
<sql:param value="${param.MobileNum}" />
<sql:param value="${param.EmailAddr}" />
</sql:update>
</c:when>
<c:otherwise>
<sql:update>
UPDATE student
SET StudentID = ?,
StudentName = ?,
Password = ?,
Dept = ?,
Major = ?,
DormNum = ?,
DormTel = ?,
MobileNum = ?,
EmailAddr = ?
WHERE studentID = ?
<sql:param value="${param.studentID}" />
<sql:param value="${param.studentName}" />
<sql:param value="${param.password}" />
<sql:param value="${param.dept}" />
<sql:param value="${param.Major}" />
<sql:param value="${param.DormNum}" />
<sql:param value="${param.DormTel}" />
<sql:param value="${param.MobileNum}" />
<sql:param value="${param.EmailAddr}" />
<sql:param value="${param.studentID}" />
</sql:update>
</c:otherwise>
</c:choose><%-- Get the new or updated data from the database --%>
<sql:query var="newstuInfo" scope="session">
SELECT * FROM student
WHERE studentID = ?
<sql:param value="${param.studentID}" />
</sql:query><%-- Redirect to the confirmation page --%>
<c:redirect url="confirmation.jsp" />请哪位好心的高手高手高高手帮忙看下问题应该怎么解决啊!感激不尽啊!
留贴到问题解决为止。
type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception javax.servlet.ServletException: Unable to get connection, DataSource invalid: "java.sql.SQLException: I/O Error: SSO Failed: Native SSPI library not loaded. Check the java.library.path system property."
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
org.apache.jsp.ch12.store_jsp._jspService(org.apache.jsp.ch12.store_jsp:111)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "java.sql.SQLException: I/O Error: SSO Failed: Native SSPI library not loaded. Check the java.library.path system property."
org.apache.taglibs.standard.tag.common.sql.UpdateTagSupport.getConnection(Unknown Source)
org.apache.taglibs.standard.tag.common.sql.UpdateTagSupport.doStartTag(Unknown Source)
org.apache.jsp.ch12.store_jsp._jspx_meth_sql_update_0(org.apache.jsp.ch12.store_jsp:276)
org.apache.jsp.ch12.store_jsp._jspx_meth_c_when_0(org.apache.jsp.ch12.store_jsp:251)
org.apache.jsp.ch12.store_jsp._jspx_meth_c_choose_0(org.apache.jsp.ch12.store_jsp:218)
org.apache.jsp.ch12.store_jsp._jspService(org.apache.jsp.ch12.store_jsp:90)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.下面是web.xml中的相关参数:
<!-- Used by the JSTL database actions -->
<context-param>
<param-name>
javax.servlet.jsp.jstl.sql.dataSource
</param-name>
<param-value>
jdbc:jtds:sqlserver://ASUS:1433;DatabaseName=tempdb
</param-value>
</context-param>以下我连接处理页面的源代码:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %><sql:setDataSource var="example" scope="application"
driver="net.sourceforge.jtds.jdbc.Driver"
url="jdbc:jtds:sqlserver://ASUS:1433;DatabaseName=wind"
user="sa"
password="sa"
/>
<%--
See if the student is already defined. If not, insert the
info, else update it.
--%>
<sql:query var="stuInfo" dataSource="${example}">
SELECT * FROM student
WHERE StudentID = ?
<sql:param value="${param.studentID}" />
</sql:query><c:choose>
<c:when test="${stuInfo.rowCount == 0}">
<sql:update>
INSERT INTO student
(StudentID,StudentName, Password, Dept, Major, DormNum,
DormTel, MobileNum, EmailAddr)
VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)
<sql:param value="${param.studentID}" />
<sql:param value="${param.studentName}" />
<sql:param value="${param.password}" />
<sql:param value="${param.dept}" />
<sql:param value="${param.Major}" />
<sql:param value="${param.DormNum}" />
<sql:param value="${param.DormTel}" />
<sql:param value="${param.MobileNum}" />
<sql:param value="${param.EmailAddr}" />
</sql:update>
</c:when>
<c:otherwise>
<sql:update>
UPDATE student
SET StudentID = ?,
StudentName = ?,
Password = ?,
Dept = ?,
Major = ?,
DormNum = ?,
DormTel = ?,
MobileNum = ?,
EmailAddr = ?
WHERE studentID = ?
<sql:param value="${param.studentID}" />
<sql:param value="${param.studentName}" />
<sql:param value="${param.password}" />
<sql:param value="${param.dept}" />
<sql:param value="${param.Major}" />
<sql:param value="${param.DormNum}" />
<sql:param value="${param.DormTel}" />
<sql:param value="${param.MobileNum}" />
<sql:param value="${param.EmailAddr}" />
<sql:param value="${param.studentID}" />
</sql:update>
</c:otherwise>
</c:choose><%-- Get the new or updated data from the database --%>
<sql:query var="newstuInfo" scope="session">
SELECT * FROM student
WHERE studentID = ?
<sql:param value="${param.studentID}" />
</sql:query><%-- Redirect to the confirmation page --%>
<c:redirect url="confirmation.jsp" />请哪位好心的高手高手高高手帮忙看下问题应该怎么解决啊!感激不尽啊!
留贴到问题解决为止。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货