oracle 青蛙toad查询,使用toad查看跟踪文件

;

String fpath = directory + "/" + list;

File f = new File(fpath);

long len;

Date  date;

String ftype;

String sqldate;

SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd kk:mm:ss");

if (f.isFile())

{

len   = f.length();

date  = new Date(f.lastModified());

sqldate = df.format(date) ;

ftype = "F";

}

else

{

len   = 0;

sqldate  = null;

ftype = "D";

}

try

{

#sql { INSERT INTO Toad_dir_listing (file_name, file_size, type, modified)

VALUES (:element, :len, :ftype, to_date(:sqldate,'YYYY-MM-DD HH24:MI:SS')) };

}

catch (OracleSQLException e)

{ /* Sometimes the date doesn't get translated propertly.  Proceeed without it. */

#sql { INSERT INTO Toad_dir_listing (file_name, file_size, type, modified)

VALUES (:element, :len, :ftype, null) };

} /* try..catch */

} /* for loop */

} /* directory exists */

else

{

throw new IOException("Folder " + directory + " does not exist on server.");

}

} /* getlist */

};

SQL> show error

Errors for JAVA SOURCE "ToadDirList":

LINE/COL ERROR

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

0/0      ToadDirList:11: incompatible types

0/0      found   : boolean

0/0      required: java.lang.Boolean

0/0      Boolean exists = (new File(directory)).exists();

0/0      ^

0/0      2 errors

0/0      found   : java.lang.Boolean

0/0      required: boolean

0/0      if (exists)

0/0      ^

0/0      ToadDirList:12: incompatible types

我把  import java.lang.Boolean;写入开头,依旧报错,我不熟悉java,那位知道错在那里.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值