如何使用java连接cache2016数据库
1、java如何连接cache2016数据库
2、java如何调用cache的函数
"Backup.General", "ExternalFreeze",
Product version: Caché 2016.1
Comments
Using the JDBC Driver | Using Java with InterSystems Software | InterSystems IRIS for Health 2023.1
请参阅这个文档来使用jdbc 链接cache 数据库,
Native SDK for Java | InterSystems IRIS for Health 2023.1
如果要调用任何的 cache 服务器端的代码,可以使用Native SDK for Java 使用方法请参阅上面的文档
public static void main(String[] args) {
EventPersister xep = null;
try {
// 1. 创建XEP持久化实例并连接
xep = PersisterFactory.createPersister();
xep.connect("ip", 1972, "%SYS", "cache", "cache");
Object result = xep.callClassMethod("SYS.Mirror", "RemoveMirroredDatabase", "worker");
// 4. 输出结果
System.out.println("备份操作结果: " + result);
} catch (Exception e) {
e.printStackTrace();
} finally {
// 5. 关闭连接
if (xep != null) {
try {
xep.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}