public class Jdbcs extends Object
| 构造器和说明 |
|---|
Jdbcs() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
camelToUnderline(String fieldName)
字段名称由驼峰格式转换为下划线格式
|
static Set<Field> |
getFields(Class<?> cls,
Set<Class<?>> superclass)
获取类及其父类中定义的字段
|
static Method |
getMethod(Set<Class<?>> classes,
String methodName,
Class<?>... parameterTypes)
获取方法
|
static Method |
getReadMethod(Class<?> cls,
Set<Class<?>> superclass,
String fieldName,
Class<?>... parameterTypes)
获取字段的读方法
|
static Object |
getResultValue(ResultSet rs,
int columnIndex,
int jdbcType,
Class<?> type)
从结果集ResultSet中取值
|
static Method |
getWriteMethod(Class<?> cls,
Set<Class<?>> superclass,
String fieldName,
Class<?>... parameterTypes)
获取字段的写方法
|
static Object |
invokeMethod(Object object,
Method method,
String errorMsg,
Object... args)
方法调用
|
static <T> T |
newInstance(Class<?> cls) |
public static Method getReadMethod(Class<?> cls, Set<Class<?>> superclass, String fieldName, Class<?>... parameterTypes)
public static Method getWriteMethod(Class<?> cls, Set<Class<?>> superclass, String fieldName, Class<?>... parameterTypes)
public static Method getMethod(Set<Class<?>> classes, String methodName, Class<?>... parameterTypes)
classes - methodName - parameterTypes - public static Object invokeMethod(Object object, Method method, String errorMsg, Object... args)
public static <T> T newInstance(Class<?> cls)
public static Object getResultValue(ResultSet rs, int columnIndex, int jdbcType, Class<?> type) throws SQLException
SQLExceptionCopyright © 2020. All rights reserved.