private static String getJdbcTypeName (int destJdbcType) {
      String destType = "";
      try {
         destType = JDBCType.valueOf(destJdbcType).getName();
      } catch (IllegalArgumentException e) {
         // try to get the name of the type from Types class based on its value
         Field[] fields = Types.class.getFields();
         for (Field field : fields) {
            if (field.getType().equals(int.class)) {
               try {
                  if (field.getInt(null) == destJdbcType) {
                     destType = field.getName();
                     break;
                  }
               } catch (IllegalAccessException e1) {
                  LOG.error("Error while getting the name of the type from Types class based on its value", e1);
               }
            }
         }

      }
      return destType;
   }
Log the error message and the column name and length that caused the error using reflection.

@param bulkCopy the SQLServerBulkCopy object
@param ex       the SQLException
src/main/java/org/replicadb/manager/SQLServerManager.java