北在北方

太白枝头看,花开不计年,杯中浮日月,楼外是青天。

导航

2012年5月14日

摘要: 项目中需要导入几十MB、上百MB的TXT文本文件,利用oracle的sql loader导入非常不错。 String cmd = "sqlldr userid=数据库用户名/密码@数据库监听实例名 skip=1 errors=0 control=d:/test.ctl data=d:/test.txt log=d:/log/log.log bad=d:/log/bad.bad ";//返回与当前 Java 应用程序相关的运行时对象 Runtime run = Runtime.getRuntime(); // 启动另一个进程来执行命令Process p = run.exec( 阅读全文

posted @ 2012-05-14 21:40 CN.programmer.Luxh 阅读(304) 评论(1) 推荐(1) 编辑

摘要: public void writeData2Txt(String content) { //存放文件的目录 String fileDir = ServletActionContext.getServletContext().getRealPath("D:/file/"); //简单的生成文件名 String fileName =new SimpleDateFormat("yyyyMMddHHmmsszzz").format(new Date())+".txt"; File txtFile= new File(fileDir,fileN 阅读全文

posted @ 2012-05-14 14:05 CN.programmer.Luxh 阅读(543) 评论(2) 推荐(0) 编辑

摘要: Map<Object,Object> map = new HashMap<Object,Object>();Iterator<Entry<Object,Object>> iterator = map.entrySet().iterator();while(iterator.hasNext()) { Entry<Object,Object> entry = iterator.next(); Object key = entry.getKey(); Object value = entry.getValue();}Entry存的是Map的 阅读全文

posted @ 2012-05-14 13:09 CN.programmer.Luxh 阅读(517) 评论(0) 推荐(1) 编辑