Untitled
unknown
plain_text
2 years ago
764 B
10
Indexable
//Pravljenje konfiguracionog fajla
String nazivBaze=txtNazivBaze.getText();
String username=txtUsername.getText();
String password=String.valueOf(txtPassword.getPassword();
if(nazivBaze.isEmpty())
{
//
retutn;
}
File appConfig=new File("dbconfig.properties");
try (Writer inputStream=new FileWriter(appConfig)) {
FileInputStream propsInput=new FileInputStream("dbconfig.properties");
Properties prop=new Properties();
prop.load(propsInput);
props.setProperty("url", "jdbc:mysql://localhost:3306/" + nazivBaze);
props.setProperty("username", username);
props.setProperty("password", password);
prop.store(inputStream, null);
//
this.dispose();
} catch (IOException ex) {
ex.printStacktTrace();
}Editor is loading...
Leave a Comment