设置RAC的归档模式
2010-07-30 14:55
471 查看
/**
* properties文件的读写操作
* @author dKF24478
*
*/
public class PropertiesHelp {
private Properties p ;
private FileInputStream inputFile;
private FileOutputStream outputFile;
private static Map<String, String> configMap = new HashMap<String, String>();
private String filePath;
public PropertiesHelp(String filePath) {
try {
this.filePath = filePath;
p = new Properties();
inputFile = new FileInputStream(filePath);
p.load(inputFile);
inputFile.close();
} catch (Exception e) {
e.printStackTrace();
}
}
public void readProperties() throws Exception {
String dbbase1 = p.getProperty("dbbase1");
String dbproject1 = p.getProperty("dbproject1");
String dbbase2 = p.getProperty("dbbase2");
String dbproject2 = p.getProperty("dbproject2");
String compareTool = p.getProperty("compareTool");
if(null == dbbase1 || "".equals(dbbase1)){
return ;
}
if(null == dbproject1 || "".equals(dbproject1)){
return ;
}
if(null == dbbase2 || "".equals(dbbase2)){
return ;
}
if(null == dbproject2 || "".equals(dbproject2)){
return ;
}
configMap.put("dbbase1", dbbase1);
configMap.put("dbproject1", dbproject1);
configMap.put("dbbase2", dbbase2);
configMap.put("dbproject2", dbproject2);
configMap.put("compareTool", compareTool);
}
public void writeProperties(Map<String, String> configMap) throws Exception {
Set<Entry<String,String>> set = configMap.entrySet();
for (Entry<String, String> entry : set) {
p.setProperty(entry.getKey(), entry.getValue());
}
outputFile = new FileOutputStream(filePath);
p.store(outputFile, "configInfo");
outputFile.close();
}
public static Map<String, String> getConfigMap() {
return configMap;
}
public static void main(String[] args) throws Exception{
PropertiesHelp ph = new PropertiesHelp("config.properties");
//ph.writeProperties();
ph.readProperties();
}
* properties文件的读写操作
* @author dKF24478
*
*/
public class PropertiesHelp {
private Properties p ;
private FileInputStream inputFile;
private FileOutputStream outputFile;
private static Map<String, String> configMap = new HashMap<String, String>();
private String filePath;
public PropertiesHelp(String filePath) {
try {
this.filePath = filePath;
p = new Properties();
inputFile = new FileInputStream(filePath);
p.load(inputFile);
inputFile.close();
} catch (Exception e) {
e.printStackTrace();
}
}
public void readProperties() throws Exception {
String dbbase1 = p.getProperty("dbbase1");
String dbproject1 = p.getProperty("dbproject1");
String dbbase2 = p.getProperty("dbbase2");
String dbproject2 = p.getProperty("dbproject2");
String compareTool = p.getProperty("compareTool");
if(null == dbbase1 || "".equals(dbbase1)){
return ;
}
if(null == dbproject1 || "".equals(dbproject1)){
return ;
}
if(null == dbbase2 || "".equals(dbbase2)){
return ;
}
if(null == dbproject2 || "".equals(dbproject2)){
return ;
}
configMap.put("dbbase1", dbbase1);
configMap.put("dbproject1", dbproject1);
configMap.put("dbbase2", dbbase2);
configMap.put("dbproject2", dbproject2);
configMap.put("compareTool", compareTool);
}
public void writeProperties(Map<String, String> configMap) throws Exception {
Set<Entry<String,String>> set = configMap.entrySet();
for (Entry<String, String> entry : set) {
p.setProperty(entry.getKey(), entry.getValue());
}
outputFile = new FileOutputStream(filePath);
p.store(outputFile, "configInfo");
outputFile.close();
}
public static Map<String, String> getConfigMap() {
return configMap;
}
public static void main(String[] args) throws Exception{
PropertiesHelp ph = new PropertiesHelp("config.properties");
//ph.writeProperties();
ph.readProperties();
}
相关文章推荐
- (04)归档模式设置大全(8i,9i,10g,11g,RAC+ASM)
- 【设置Oracle 11Gr2 RAC的归档模式】
- Oracle归档模式与非归档模式设置
- oracle9i rac环境下如何更改归档模式
- 10g RAC改归档模式步骤
- 11g RAC 更改归档模式 ,归档文件存放在ASM 磁盘组
- 【转】将Oracle数据库设置为归档模式
- 设置oracle归档模式
- 10G RAC 切换到归档模式
- 11g RAC 更改归档模式 ,归档文件存放在ASM 磁盘组
- Oracle归档模式与非归档模式设置
- Oracle-->数据库备份与恢复-->数据库归档模式设置
- DB2数据库设置归档模式
- Oracle11g RAC开启关闭、设置归档
- Oracle归档模式与非归档模式设置
- oracle 设置归档模式
- windows xp 系统下安装完oracle后,设置归档模式的过程以及方法!
- oralce 10g rac 归档模式修改
- db2 设置归档模式
- Oracle11gR2 RAC环境归档模式的配置