JSP连接SQLServer2000
我在用JSP连接SQL2000时出现如下问题:Anerroroccurredatline:25inthejspfile:/register_new_user.jspDri...
我在用JSP连接SQL2000时出现如下问题:An error occurred at line: 25 in the jsp file: /register_new_user.jsp
DriveManager cannot be resolved
22: String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=QQ number management system";
23: String user="sa";
24: String password="chenmeng";
25: conn = DriveManager.getConnection(url,user,password);
26: stmt = conn.createStatement();
27: rs =stmt.executeQuery(selectquery);
28: if(rs.next){
An error occurred at line: 28 in the jsp file: /register_new_user.jsp
rs.next cannot be resolved or is not a field
25: conn = DriveManager.getConnection(url,user,password);
26: stmt = conn.createStatement();
27: rs =stmt.executeQuery(selectquery);
28: if(rs.next){
29: reponse.sendRedirect("register.html");
30: return;
31: }
An error occurred at line: 29 in the jsp file: /register_new_user.jsp
reponse cannot be resolved
26: stmt = conn.createStatement();
27: rs =stmt.executeQuery(selectquery);
28: if(rs.next){
29: reponse.sendRedirect("register.html");
30: return;
31: }
32: else
我的msutil.jar,ms.base.jar,mssqlserver.jar已经放置到C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib目录下。
java中的环境变量设置如下:CLASS_PATH.;C:\Program Files\Java\jdk1.6.0_10\bin;C:\Program Files\Java\jdk1.6.0_10\lib;C:\Program Files\Java\jdk1.6.0_10\lib\dt.jar;C:\Program Files\Java\jdk1.6.0_10\lib\tools.jar;C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\servlet-api.jar;C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\msutil.jar;C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\msbase.jar;C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\mssqlserver.jar
JAVA_HOME:C:\Program Files\Java\jdk1.6.0_10
PATH:C:\Program Files\Java\jdk1.6.0_10\bin
可就是连不上,哪位大虾帮帮忙啊!多谢啦!
很感谢二楼的,不过现在我按照你说的改了,但还有一个问题:org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 25 in the jsp file: /register_new_user.jsp
DriveManager cannot be resolved
22: String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=QQ number management system";
23: String user="sa";
24: String password="chenmeng";
25: conn = DriveManager.getConnection(url,user,password);
26: stmt = conn.createStatement();
27: rs =stmt.executeQuery(selectquery);
28: if(rs.next()){
我的数据库名为“QQ number management system"用户名为sa密码:chenmeng.我用的是SQL2000. 展开
DriveManager cannot be resolved
22: String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=QQ number management system";
23: String user="sa";
24: String password="chenmeng";
25: conn = DriveManager.getConnection(url,user,password);
26: stmt = conn.createStatement();
27: rs =stmt.executeQuery(selectquery);
28: if(rs.next){
An error occurred at line: 28 in the jsp file: /register_new_user.jsp
rs.next cannot be resolved or is not a field
25: conn = DriveManager.getConnection(url,user,password);
26: stmt = conn.createStatement();
27: rs =stmt.executeQuery(selectquery);
28: if(rs.next){
29: reponse.sendRedirect("register.html");
30: return;
31: }
An error occurred at line: 29 in the jsp file: /register_new_user.jsp
reponse cannot be resolved
26: stmt = conn.createStatement();
27: rs =stmt.executeQuery(selectquery);
28: if(rs.next){
29: reponse.sendRedirect("register.html");
30: return;
31: }
32: else
我的msutil.jar,ms.base.jar,mssqlserver.jar已经放置到C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib目录下。
java中的环境变量设置如下:CLASS_PATH.;C:\Program Files\Java\jdk1.6.0_10\bin;C:\Program Files\Java\jdk1.6.0_10\lib;C:\Program Files\Java\jdk1.6.0_10\lib\dt.jar;C:\Program Files\Java\jdk1.6.0_10\lib\tools.jar;C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\servlet-api.jar;C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\msutil.jar;C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\msbase.jar;C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\mssqlserver.jar
JAVA_HOME:C:\Program Files\Java\jdk1.6.0_10
PATH:C:\Program Files\Java\jdk1.6.0_10\bin
可就是连不上,哪位大虾帮帮忙啊!多谢啦!
很感谢二楼的,不过现在我按照你说的改了,但还有一个问题:org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 25 in the jsp file: /register_new_user.jsp
DriveManager cannot be resolved
22: String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=QQ number management system";
23: String user="sa";
24: String password="chenmeng";
25: conn = DriveManager.getConnection(url,user,password);
26: stmt = conn.createStatement();
27: rs =stmt.executeQuery(selectquery);
28: if(rs.next()){
我的数据库名为“QQ number management system"用户名为sa密码:chenmeng.我用的是SQL2000. 展开
6个回答
展开全部
如果你觉得你链接的URL没错的话,用Java连SQL SERVER 2000的数据库的时候 请一定要打上至少是SP3 以上的补丁。 这是用2000数据库的人都知道的,我想你不会没打吧 如果是这样 那你太大意了,网上下个补丁,最好是sp4补丁,还有一点,好像java链接2000数据库和java链接2005 数据库的URL 好像有点不一样 具体我记不太清 请仔细核对!
String user= "sa";
String passWord="123456";
String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=jhsy;
con=DriverManager.getConnection( url,user, passWord);
好像你的配置是对的 ,如果补丁打上还是错的话 。那就OH MY god 了
String user= "sa";
String passWord="123456";
String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=jhsy;
con=DriverManager.getConnection( url,user, passWord);
好像你的配置是对的 ,如果补丁打上还是错的话 。那就OH MY god 了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
大雅新科技有限公司
2024-11-19 广告
2024-11-19 广告
这方面更多更全面的信息其实可以找下大雅新。深圳市大雅新科技有限公司从事KVM延长器,DVI延长器,USB延长器,键盘鼠标延长器,双绞线视频传输器,VGA视频双绞线传输器,VGA延长器,VGA视频延长器,DVI KVM 切换器等,优质供应商,...
点击进入详情页
本回答由大雅新科技有限公司提供
展开全部
An error occurred at line: 28 in the jsp file: /register_new_user.jsp
rs.next cannot be resolved or is not a fie
写的很清楚,next不是属性,应该是next()
An error occurred at line: 29 in the jsp file: /register_new_user.jsp
reponse cannot be resolved
是response 不是reponse
DriveManager这个类你import进去了没有
rs.next cannot be resolved or is not a fie
写的很清楚,next不是属性,应该是next()
An error occurred at line: 29 in the jsp file: /register_new_user.jsp
reponse cannot be resolved
是response 不是reponse
DriveManager这个类你import进去了没有
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
第一,是否安装SP3或者更高的数据库补丁。
第二,是否导入相应的包
第三,Databasename是否支持带空格的数据库名
我想问题应该是出在这三个地方的某一处或多处
第二,是否导入相应的包
第三,Databasename是否支持带空格的数据库名
我想问题应该是出在这三个地方的某一处或多处
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
if(rs.next){}
少括号,rs.next()才对。
你用的啥编程工具啊,这种错误应该会有提示的。
少括号,rs.next()才对。
你用的啥编程工具啊,这种错误应该会有提示的。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你的SQL版本多少?你打开查询分析器的帮助看看
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询