0

Hi I am using below code for propertyfile updation. The problem is that // is changing to \/\/ and \ is removing. I saw one Post that someone used 1.10 jar for commons-configuration-1.10 and it is working, but I have used this but it is not working for me. Is there any other jars to avoid this.

PropertiesConfiguration databaseProperties;
databaseProperties = new PropertiesConfiguration("Properties.properties");
databaseProperties.setProperty("PropName", "jdbc:sqlserver://");
databaseProperties.save();

Thanks

Guillaume S
  • 1,462
  • 2
  • 19
  • 31
amitabh pandey
  • 65
  • 1
  • 11
  • what do you mean by "// is changing to // and \ is removing"? – Dmitry Senkovich May 07 '18 at 09:43
  • Means Backslash(\) get removed and forwaedslash(/) updated with \/.If value is Path=jdbc:sqlserver:// Then it will become jdbc:salserver:\/\/ after update.https://stackoverflow.com/questions/5342231/propertiesconfiguration-using-in-property-value/50210811#50210811 this is another old thread about the same.May be it will help you. – amitabh pandey May 07 '18 at 10:05
  • Instead of writing // in quotes, you can take help of File.separator like "jdbc:sqlserver:"+File.separator – foxt7ot May 07 '18 at 11:41
  • if I use File.separator then it changing forwardslash(//) to backslash(\\). – amitabh pandey May 08 '18 at 04:06

0 Answers0