private static PreparedStatementSetter getPss(String tableName, Object[] args, String[] argNames) {
TableMetaData tmd = queryForMapHandler.getTableMetaData(tableName);
if (tmd == null) {
log.error("Can't find cached MetaData for table " + tableName);
return new ArgPreparedStatementSetter(args);
}
if (args != null && argNames != null && argNames.length != args.length) {
log.error("Parameters length can't match the parameter name length. table:" + tableName + ",args.length:"
+ args.length + ",argNames.length:" + argNames.length);
return new ArgPreparedStatementSetter(args);
}
ColumnMetaData[] argMetas = new ColumnMetaData[argNames.length];
for (int i = 0; i < argNames.length; i++) {
argMetas[i] = tmd.getColumnMetaData(argNames[i]);