/**
* 类反射实现动态类调用
* @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[]{});
}