/**
* 類反射實(shí)現(xiàn)動(dòng)態(tài)類調(diào)用
* @param instance 一個(gè)信息獲取類的實(shí)例
* @param methodName 方法名稱
* @param classes 參數(shù)類型數(shù)組
* @param objects 參數(shù)數(shù)組
* @return Object 返回了方法執(zhí)行后的結(jié)果
*/
private Object invokeInstanceMethod(
final Object instance, final String methodName,
final Class[] classes, final Object[] objects) {
try {
Method method;
try {
method = instance.getClass().getDeclaredMethod(methodName, classes);
}
catch (NoSuchMethodException e) {
method = instance.getClass().getMethod(methodName, classes);
}
method.setAccessible(true);
return method.invoke(instance, objects);
}
catch (NoSuchMethodException e) {
throw new RuntimeException(e.getMessage());
}
catch (IllegalAccessException e) {
throw new RuntimeException(e.getMessage());
}
catch (InvocationTargetException e) {
throw new RuntimeException(e.getTargetException().getMessage());
}
}
/* (非 Javadoc)
* @see com.eware.dataBaseOperation.dataOperateToolKit
* .dataBaseOperate.InterFaceGetOwnerDataInfo#getOwnerTables()
*/
/**
* 實(shí)現(xiàn)了接口方法獲取當(dāng)前用戶所有表的信息
*/
public ResultSet getOwnerTables() {
// TODO 自動(dòng)生成方法存根
return (ResultSet)invokeInstanceMethod(goic, "getOwnerTables",
new Class[]{}, new Object[]{});
}