use properties write to config.properties files
来源:互联网 发布:网络数据包发送工具 编辑:程序博客网 时间:2024/05/22 07:00
//将数据写入到propertiesProperties prop = new Properties();FileOutputStream out = null;try{ String path = this.getClass().getClassLoader().getResource("").getPath(); // 从输入流中读取属性列表(键和元素对) // 调用 Hashtable 的方法 put。使用 getProperty 方法提供并行性。 // 强制要求为属性的键和值使用字符串。返回值是 Hashtable 调用 put 的结果。 prop.setProperty("sqladdr", sqladdr); prop.setProperty("sqluser",sqluser); prop.setProperty("sqlpassword",sqlpassword); out = new FileOutputStream(path + "/config.properties"); prop.store(out, "save"); // 以适合使用 load 方法加载到 Properties 表中的格式, // 将此 Properties 表中的属性列表(键和元素对)写入输出流} catch (IOException e) { logger.error("----read file error---",e);}finally { if(out != null){ try { out.close(); } catch (IOException e) { logger.error("----read file error---",e); } }}
1 0
- use properties write to config.properties files
- How to use java Properties API -- read and write
- config.properties
- config.properties
- properties read write example
- java - properties read write
- how to use Properties and File to Save Data
- Use properties file
- 使用config.properties文件
- 读取config.properties信息
- config.properties的配置
- How to use java logging with logging.properties
- tigase WARNING: Dumping server configuration to: etc/config-dump.properties
- Properties
- properties
- Properties
- PROPERTIES
- Properties
- 大学食堂之HMM模型(三)——Baum-Walch算法
- 在Eclipse中设置进行JNI的头文件编译方法
- Activity堆栈管理器 以及 应用退出的两种方案
- AngularJs的controller 多次执行问题
- 解释器模式——定义一种简单的语言
- use properties write to config.properties files
- java中thread的start()和run()的区别
- java中的Semaphore
- 迭代器模式一访问人员列表
- Android中元素按比例布局
- 要时刻绷紧生命的弦
- http缓存
- Android设置Button各种状态下背景改变
- Java设计模式三(原型模式、适配器模式)