private static String getMethodValue(String methodName,
Object databaseBean) throws SecurityException,
IllegalArgumentException, NoSuchMethodException,
IllegalAccessException, InvocationTargetException {
String strResult = "";
Class[] types = {};
Object[] args = {};
java.lang.reflect.Method m;
try {
m = databaseBean.getClass().getMethod(
methodName, types);
strResult = String.valueOf(m.invoke(databaseBean, args));
} catch (SecurityException e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw e;
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw e;
} catch (NoSuchMethodException e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw e;
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw e;
} catch (InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw e;
}
return strResult;
}
Object databaseBean) throws SecurityException,
IllegalArgumentException, NoSuchMethodException,
IllegalAccessException, InvocationTargetException {
String strResult = "";
Class[] types = {};
Object[] args = {};
java.lang.reflect.Method m;
try {
m = databaseBean.getClass().getMethod(
methodName, types);
strResult = String.valueOf(m.invoke(databaseBean, args));
} catch (SecurityException e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw e;
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw e;
} catch (NoSuchMethodException e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw e;
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw e;
} catch (InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw e;
}
return strResult;
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货