Here's the code in case you're interested:
\nUShortInt version = new UShortInt(7000);\nAnsiString output_dir = new AnsiString("c:\\tmp");\nconnectparms = new AnsiString("uid=<...>;pwd=<...>;dsn=<...>");\nAnsiString startline = new AnsiString("");\nConfirmCallback confirmrtn = new ConfirmCallback();\nErrorCallback errorrtn = new ErrorCallback();\nMessageCallback msgrtn = new MessageCallback();\nStatusCallback statusrtn = new StatusCallback();\nChar bitFields = new Char((char) 15); // flags are 00001111\nAnsiString hotlog_filename = new AnsiString();\nChar backup_interrupted = new Char();\n\nStructure backup_info = new Structure(new Parameter[] {\n version,\n new Pointer(output_dir),\n new Pointer(connectparms),\n new Pointer(startline),\n confirmrtn,\n errorrtn,\n msgrtn,\n statusrtn,\n bitFields,\n new Pointer(hotlog_filename),\n backup_interrupted }, (short) 1);\n\nErrorCallback dbtinfo_errorrtn = new ErrorCallback();\nStructure dbtinfo = new Structure(new Parameter[] {dbtinfo_errorrtn});\n\nLibrary dbtool = new Library("dbtool7.dll"); \nFunction dbbackup = dbtool.getFunction("_DBBackup@4");\nFunction dbtoolsinit = dbtool.getFunction("_DBToolsInit@4");\nFunction dbtoolsfini = dbtool.getFunction("_DBToolsFini@4");\n\t\t\ndbtoolsinit.invoke(null, new Pointer(dbtinfo));\ndbbackup.invoke(null, new Pointer(backup_info));\ndbtoolsfini.invoke(null, new Pointer(dbtinfo));\n\nconfirmrtn.dispose();\nerrorrtn.dispose();\nmsgrtn.dispose();\nstatusrtn.dispose();\ndbtinfo_errorrtn.dispose();And here is a sample callback (they are all the identical with different class names):
\n/*\n extern short _callback ErrorCallBack(char far * str);\n*/\nclass ErrorCallback extends Callback {\n private ShortInt result = new ShortInt();\n private AnsiString message = new AnsiString();\n public ErrorCallback() {\n init(new Parameter[] { new Pointer(message) }, result);\n }\n public void callback() {\n System.out.println("ErrorCallback -> " + message);\n result.setValue(0);\n }\n}This means the only JNI I need in my application is the PowerBuilder to Java bridge. I just got rid of a whole bunch of C code with this thing!