要处理异常try{String db_database=db.read_dataname();}
catch(FileNotFoundException){}
catch(FileNotFoundException){}
解决方案 »
- 用来更改密码的程序,但是就算帐号密码都提供正确了也改不了
- 在我的电脑上一直提示的问题,在别人电脑上就不会,是软件没装好?是哪里不行呢?
- jsp登录 的调试
- apache2.2+tomcat5.5整合后directoryindex的问题
- 江湖救急 关于jdom
- JSP与Mysql的中文问题
- 倾家荡产提一个巨难的问题,请高手们来讨论..
- 请问谁能告诉我以下2种方法的实现对客户端的显示有区别吗?
- 在查询时,遇到原始数据带双引号,使用group_concat时希望去掉或者替换双引号
- springboot使用Redis集群速度慢的问题
- ◆如果文本框中是空的,那么request.getParameter得到的什么值?◆
- 100讨论(求)读取远程xml方法并保存在本地以备后用
String db_database=db.read_dataname();
}cathch(Excetion E){
//错误处理
}
config.conn db=new config.conn();
try{
String db_database=db.read_dataname();
}
catch(FileNotFoundException){
}
编译以下错误
D:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\ROOT\WEB-INF\clas
ses\Eclass\News.java:831: illegal start of type
try{
^
try{
...
}
catch(FileNotFoundException e){
}
catch(IOException e){
}
什么意思
不过加了e之后错误还是一样啊
一下程序可以调试通用的
package config;
import java.io.*;public class conn3
{public static void main(String[] args) throws FileNotFoundException, IOException
{
String dn=read_dataname();
System.out.println(dn);
}
public static String read_dataname() throws FileNotFoundException, IOException
{
BufferedReader in= new BufferedReader(new FileReader("d:/test.txt"));
String dataname=new String();
String username=new String();
String password=new String();
dataname=in.readLine();
username=in.readLine();
password=in.readLine();
return dataname;
}}
上面的问题解决了,谢谢!