ගානක් දීපියකවුරු හරි දන්නවනම් මට කියල දෙන්නකෝ java වලින් mysql database එකෙන් ගත්තු backup එක restore කරන හැටි
මං නෙට් එකේ පීර පීර හෙව්වා එක එක ඒවා හම්බු උනා. එකකින් වත් හරියට වැඩේ කරගන්න බැරිවුනා. දැන් එපාවෙලා ඉන්නේ අප්පා. මං මේ තාම නිදි නෑ.මේ project එකක් දාගෙන හදනවා . දැන් මේක එපා වෙලා අප්පා ඉන්නේ pissu wage
![]()

Code:
public static void setRestore(String source, Component component) {
ResultSet rs = db.getdata("SELECT @@basedir");
try {
if (rs.first()) {
String path = "\"" + rs.getString(1) + "bin" + "\\mysql.exe\" -uroot -p123 testdb -e \"source " + source + "\"";
System.out.println(path);
Process pros = Runtime.getRuntime().exec(path);
int count = pros.waitFor();
if (count == 0) {
MessageDialog.customInfoDialog(component, "Backup restored successfully!\nPlease restart the system.");
System.exit(0);
} else {
MessageDialog.customErrorDialog(component, "Could not restore the backup file.");
}
}
} catch (SQLException ex) {
Logger.getLogger(dbHandling.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(dbHandling.class.getName()).log(Level.SEVERE, null, ex);
} catch (InterruptedException ex) {
Logger.getLogger(dbHandling.class.getName()).log(Level.SEVERE, null, ex);
}
}
මේ project එකක් දාගෙන හදනවා . දැන් මේක එපා වෙලා අප්පා ඉන්නේ pissu wage 






