| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 603 人关注过本帖
标题:请问一下数据库连接的问题。。
只看楼主 加入收藏
woohyuk
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2005-10-24
收藏
 问题点数:0 回复次数:2 
请问一下数据库连接的问题。。
请问一下数据库连接的问题,, 我总把连接数据库的代码统一的放在一个文件里,,比如说叫connectdb.jsp 可是总是出现错误。。。应该怎么去改,,,错误信息如下: [求助]jsp+msSql连接错误

type Exception report

message

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

exception

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 2 in the jsp file: /incoming/connectdb.jsp
Generated servlet error:
D:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\news\org\apache\jsp\incoming\connectdb_jsp.java:48: cannot resolve symbol
symbol  : class Connection 
location: class org.apache.jsp.incoming.connectdb_jsp
  Connection con=DriverManager.getConnection(url,"sa","123");
  ^


An error occurred at line: 2 in the jsp file: /incoming/connectdb.jsp
Generated servlet error:
D:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\news\org\apache\jsp\incoming\connectdb_jsp.java:48: cannot resolve symbol
symbol  : variable DriverManager 
location: class org.apache.jsp.incoming.connectdb_jsp
  Connection con=DriverManager.getConnection(url,"sa","123");
                 ^


An error occurred at line: 2 in the jsp file: /incoming/connectdb.jsp
Generated servlet error:
D:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\news\org\apache\jsp\incoming\connectdb_jsp.java:49: cannot resolve symbol
symbol  : class Statement 
location: class org.apache.jsp.incoming.connectdb_jsp
  Statement
  ^


An error occurred at line: 2 in the jsp file: /incoming/connectdb.jsp
Generated servlet error:
D:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\news\org\apache\jsp\incoming\connectdb_jsp.java:50: cannot resolve symbol
symbol  : variable ResultSet 
location: class org.apache.jsp.incoming.connectdb_jsp
smt=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
                        ^


An error occurred at line: 2 in the jsp file: /incoming/connectdb.jsp
Generated servlet error:
D:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\news\org\apache\jsp\incoming\connectdb_jsp.java:50: cannot resolve symbol
symbol  : variable ResultSet 
location: class org.apache.jsp.incoming.connectdb_jsp
smt=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
                                                        ^


An error occurred at line: 2 in the jsp file: /incoming/connectdb.jsp
Generated servlet error:
D:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\news\org\apache\jsp\incoming\connectdb_jsp.java:51: cannot resolve symbol
symbol  : class ResultSet 
location: class org.apache.jsp.incoming.connectdb_jsp
  ResultSet rs;
  ^
6 errors



	org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
	org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
	org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
	org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
	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.

搜索更多相关主题的帖子: 数据库 
2005-10-24 17:16
jeremydomett
Rank: 2
等 级:新手上路
威 望:3
帖 子:312
专家分:0
注 册:2004-6-10
收藏
得分:0 
能把程序发一下么。。

热爱编程........永不放弃.........
2005-10-30 10:06
疯子java
Rank: 4
等 级:贵宾
威 望:13
帖 子:328
专家分:0
注 册:2004-9-19
收藏
得分:0 

应该是你的很多类都没有import进来哈
才会出现什么目标不能确定拉等问题


疯言疯语 疯部可及 ---世界法第1章第1节第1条规定 此人由于说话太过于疯!!!其余人等切不可与其交谈! 此人由于说话太过于疯!!!此人的话100%的不能相信
2005-10-31 15:18
快速回复:请问一下数据库连接的问题。。
数据加载中...
 
   



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

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