Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Cannot save a url as a value in a PropertiesConfiguration object
- PropertiesConfiguration pc = new PropertiesConfiguration();
- pc.setProperty("url", "jdbc:postgres://localhost:5432/somedb");
- pc.setBasePath(".");
- pc.setFileName("my.properties");
- url = jdbc:postgres://localhost:5432/somedb.
- public class PropertiesTest {
- public static void main(String[] args) throws Exception {
- Properties props = new Properties();
- props.put("url", "jdbc:postgres://localhost:5432/somedb");
- OutputStream out = new FileOutputStream("my.properties");
- props.store(out, null);
- }
- }
- url=jdbc:postgres://localhost:5432/somedb
- public static void main(String[] args) throws Exception {
- File props = new File("my_raw.properties");
- BufferedWriter writer = new BufferedWriter(new FileWriter(props));
- writer.write("url=jdbc:postgres://localhost:5432/somedb");
- writer.close();
- }
Add Comment
Please, Sign In to add comment