/**
* 類反射實現動態類調用
* @param instance 一個信息獲取類的實例
* @param methodName 方法名稱
* @param classes 參數類型數組
* @param objects 參數數組
* @return Object 返回了方法執行后的結果
*/
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()
*/
/**
* 實現了接口方法獲取當前用戶所有表的信息
*/
public ResultSet getOwnerTables() {
// TODO 自動生成方法存根
return (ResultSet)invokeInstanceMethod(goic, "getOwnerTables",
new Class[]{}, new Object[]{});
}