首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

再看:jsp连接 oracle 的有关问题,眼都看晕了

2013-09-11 
再看:jsp连接 oracle 的问题,眼都看晕了昨天找了一天原因,眼都快看晕了..还是不行...请高手们帮人分析一下

再看:jsp连接 oracle 的问题,眼都看晕了
昨天找了一天原因,眼都快看晕了..还是不行...请高手们帮人分析一下..查了以前的贴,都试了还是不行..


<%@   page   contentType= "text/html;charset=gb2312 "%>  
<%@   page   import= "java.sql.* "%>  
<html>  
<body>  
<%


Class.forName( "oracle.jdbc.driver.OracleDriver ").newInstance();        
String   url= "jdbc:oracle:thin:@localhost:1521:orcl ";  
//orcl为你的数据库的SID  
String   user= "sqlfun ";  
String   password= "puppy ";  
Connection   conn=   DriverManager.getConnection(url,user,password);        
Statement   stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);        
String   sql= "select   *   from   test ";        
ResultSet   rs=stmt.executeQuery(sql);        
while(rs.next())   {%>        
您的第一个字段内容为: <%=rs.getString( "userid ")%>        
  <br>
<%
}


%>  


</body>  
</html>


type   Exception   report

message  

description   The   server   encountered   an   internal   error   ()   that   prevented   it   from   fulfilling   this   request.

exception  

javax.servlet.ServletException:   oracle.jdbc.driver.OracleDriver
at   org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:498)
at   org.apache.jsp.love_jsp._jspService(love_jsp.java:99)
at   org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92)
at   javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
at   org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:162)
at   org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
at   org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
at   javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
at   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
at   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
at   org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
at   org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at   org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at   org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at   org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
at   org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at   org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at   org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at   org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
at   org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
at   org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at   org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
at   org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)


at   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
at   org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at   org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at   org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at   org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
at   org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at   org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at   org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at   org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
at   org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at   org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at   org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at   org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at   java.lang.Thread.run(Unknown   Source)


root   cause  

java.lang.ClassNotFoundException:   oracle.jdbc.driver.OracleDriver
at   org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1407)
at   org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1252)
at   org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:149)
at   org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:83)
at   java.lang.ClassLoader.loadClassInternal(Unknown   Source)
at   java.lang.Class.forName0(Native   Method)
at   java.lang.Class.forName(Unknown   Source)
at   org.apache.jsp.love_jsp._jspService(love_jsp.java:72)
at   org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92)
at   javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
at   org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:162)
at   org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
at   org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
at   javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
at   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
at   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
at   org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
at   org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at   org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at   org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at   org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
at   org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at   org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at   org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at   org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
at   org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
at   org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at   org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)


at   org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
at   org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at   org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at   org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at   org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
at   org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at   org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at   org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at   org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
at   org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at   org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at   org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at   org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at   java.lang.Thread.run(Unknown   Source)


--------------------------------------------

Apache   Tomcat/4.1.31

[解决办法]
oracle\ora92\jdbc\lib目录下的class111.jar和class12.jar放到tomcat的share/lib下就可以了
[解决办法]
oracle\ora92\jdbc\lib目录下的class111.jar和class12.jar放到tomcat的common\lib下就可以了

我的异常网推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.myexception.cn/java-web/317.html

热点排行