CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
花落谁家,你作主! 盛大widget设计大赛英雄榜
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  Java >  J2SE / 基础类

可怕的 "System.err.println("asdfdsf");"

楼主NoWant(NoWant)2001-03-12 23:18:00 在 Java / J2SE / 基础类 提问

在win2000+tomcat3.2+apache+JServ1.2上调试servlet(tunnel)程序。  
  数据库ResultSet错误,   使用"System.err.println("asdfdsf");"显示。  
  出错时,不能显示程序也暂停,必须在tomcat的操作窗口敲回车键,才能显  
   
  示并继续运行程序。  
  请问有无高手遭遇类似问题?how   to   ?  
   
   
   
  怎样判断   ResultSet!=null   但是   ResultSet中又无记录的情况???  
  example:  
   
  myResultSet=myStatement.executeQuery("Select   *   from   myTable   where   1>2");  
   
  如果myResultSet.next()   catch不到错误。  
   
   
   
   
   
   
  问题点数:80、回复次数:5Top

1 楼skyyoung(路人甲)回复于 2001-03-13 09:21:00 得分 10

if(myResultSet.next())   //如果有记录  
  {  
      ....  
  }Top

2 楼skyyoung(路人甲)回复于 2001-03-13 09:23:00 得分 10

用System.out.println("error");不行吗Top

3 楼lmy2000(pluto)回复于 2001-03-13 09:31:00 得分 20

用while比较好。  
  try    
  {  
  while(myResultSet.next())   //如果有记录  
  {  
      ....  
  }    
  }  
  catch(Exception   e){  
        System.out.println(e);  
  }Top

4 楼skyyoung(路人甲)回复于 2001-03-13 09:31:00 得分 40

(copy)  
  By   default,   they   will   go   to   the   console   where   the   tomcat   is   started.   You   have   to   modify   the   startup   scripts   to   redirect   them   to   appropriate   files.   See   Tomcat   Mailing   List(http://mikal.org/interests/java/tomcat_users/msg03276.html)   for   a   discussion   on   how   to   redirect   the   System.out   and   System.err.    
  On   the   other   hand,   if   you   are   running   Tomcat   as   an   NT   Service,   you   can   modify   the   conf/wrapper.properties   file   and   set   wrapper.stdout   and   wrapper.stderr   properties   to   point   to   your   log   files.  
   
  Top

5 楼NoWant(NoWant)回复于 2001-03-16 09:56:00 得分 0

用System.out.println("error");不行吗    
  的确有问题Top

相关问题

  • 可怕。。。。。。
  • 可怕的私企?!!!!!!!!!
  • Thumbs.db很可怕哦!!!!!!!!!
  • 可怕的病毒????
  • 可怕的陷阱(mssqlserver、delphi)
  • 可怕的可乐(转)
  • 四个可怕的故事
  • 太可怕了,女人
  • [转帖]可怕的女人
  • 我的apache好可怕

关键词

  • tomcat
  • myresultset
  • err
  • wrapper
  • 程序
  • println
  • resultset
  • 显示
  • next

得分解答快速导航

  • 帖主:NoWant
  • skyyoung
  • skyyoung
  • lmy2000
  • skyyoung

相关链接

  • CSDN Java频道
  • Java类图书
  • Java类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo