UPDATE:
I managed to compile the mysql-backup4j into a jar file and now I'm working on instantiating it as an #AdditionalJar
From what I can make out from the java examples on Seun Matt's website, (
https://smattme.com/blog/technology...atabase-programmatically-using-mysql-backup4j), I need to set up some properties as configuration,
They are these:
//required properties for exporting of db
Properties properties = new Properties();
properties.setProperty(MysqlExportService.DB_NAME, "database-name");
properties.setProperty(MysqlExportService.DB_USERNAME, "root");
properties.setProperty(MysqlExportService.DB_PASSWORD, "root");
//properties relating to email config
properties.setProperty(MysqlExportService.EMAIL_HOST, "smtp.mailtrap.io");
properties.setProperty(MysqlExportService.EMAIL_PORT, "25");
properties.setProperty(MysqlExportService.EMAIL_USERNAME, "mailtrap-username");
properties.setProperty(MysqlExportService.EMAIL_PASSWORD, "mailtrap-password");
properties.setProperty(MysqlExportService.EMAIL_FROM, "[email protected]");
properties.setProperty(MysqlExportService.EMAIL_TO, "[email protected]");
//set the outputs temp dir
properties.setProperty(MysqlExportService.TEMP_DIR, new File("external").getPath());
MysqlExportService mysqlExportService = new MysqlExportService(properties);
mysqlExportService.export();
But, B4J won't accept a Map as a suitable object to pass the config in
'===========INITILIZE BACKUP OBJECT====================
Private DBackup As JavaObject
Dim Prpt As Map
Prpt.Initialize
Prpt.Put("DB_NAME", DBName) ' defined elsewhwre
Prpt.Put("DB_USERNAME", DBUsername)
Prpt.Put("DB_PASSWORD", DBPassword)
Prpt.Put("EMAIL_HOST", "smtp.server.com")
Prpt.Put("EMAIL_PORT", "465")
Prpt.Put("EMAIL_USERNAME", "emailuser")
Prpt.Put("EMAIL_PASSWORD", "emailpass")
Prpt.Put("EMAIL_FROM", "[email protected]")
Prpt.Put("EMAIL_TO", "[email protected]")
Prpt.Put("TEMP_DIR", "C:\Users\Public\Documents")
DBackup.InitializeNewInstance("com.smattme.mysql-backup4j", Prpt)
DBackup.RunMethod("export", Null)
If anyone has any pointers or ideas, I'd be really grateful...